config/network: Prepare for multiple networks
This commit futures proofs the code to allow for usage of more than one docker network.
This commit is contained in:
parent
db1989a299
commit
e969351f8e
13 changed files with 40 additions and 28 deletions
|
|
@ -1,6 +1,15 @@
|
|||
package config
|
||||
|
||||
type DockerConfig struct {
|
||||
// name of docker network to use
|
||||
Network string `yaml:"network" default:"distillery" validate:"nonempty"`
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue