wisski-cloud-distillery/internal/config/docker.go
Tom Wiesing e969351f8e
config/network: Prepare for multiple networks
This commit futures proofs the code to allow for usage of more than one
docker network.
2023-03-13 10:11:28 +01:00

15 lines
457 B
Go

package config
type DockerConfig struct {
NetworkPrefix string `yaml:"network" default:"distillery" validate:"nonempty"`
}
// Networks returns a list of all docker networks to be created for purposes of the distillery.
func (dc DockerConfig) Networks() []string {
return []string{dc.Network()}
}
// Network returns the name of the default network to attach all docker containers to.
func (dc DockerConfig) Network() string {
return dc.NetworkPrefix
}