github.com/bdwilliams/libcompose@v0.3.1-0.20160826154243-d81a9bdacff0/docker/network/factory.go (about) 1 package network 2 3 import ( 4 "github.com/docker/libcompose/config" 5 composeclient "github.com/docker/libcompose/docker/client" 6 "github.com/docker/libcompose/project" 7 ) 8 9 // DockerFactory implements project.NetworksFactory 10 type DockerFactory struct { 11 ClientFactory composeclient.Factory 12 } 13 14 // Create implements project.NetworksFactory Create method. 15 // It creates a Networks (that implements project.Networks) from specified configurations. 16 func (f *DockerFactory) Create(projectName string, networkConfigs map[string]*config.NetworkConfig, serviceConfigs *config.ServiceConfigs, networkEnabled bool) (project.Networks, error) { 17 cli := f.ClientFactory.Create(nil) 18 return NetworksFromServices(cli, projectName, networkConfigs, serviceConfigs, networkEnabled) 19 }