libcompose: github.com/docker/libcompose/docker/network Index | Files

package network

import "github.com/docker/libcompose/docker/network"

Index

Package Files

factory.go network.go

type DockerFactory Uses

type DockerFactory struct {
    ClientFactory composeclient.Factory
}

DockerFactory implements project.NetworksFactory

func (*DockerFactory) Create Uses

func (f *DockerFactory) Create(projectName string, networkConfigs map[string]*config.NetworkConfig, serviceConfigs *config.ServiceConfigs, networkEnabled bool) (project.Networks, error)

Create implements project.NetworksFactory Create method. It creates a Networks (that implements project.Networks) from specified configurations.

type Network Uses

type Network struct {
    // contains filtered or unexported fields
}

Network holds attributes and method for a network definition in compose

func NewNetwork Uses

func NewNetwork(projectName, name string, config *config.NetworkConfig, client client.NetworkAPIClient) *Network

NewNetwork creates a new network from the specified name and config.

func (*Network) EnsureItExists Uses

func (n *Network) EnsureItExists(ctx context.Context) error

EnsureItExists make sure the network exists and return an error if it does not exists and cannot be created.

func (*Network) Inspect Uses

func (n *Network) Inspect(ctx context.Context) (types.NetworkResource, error)

Inspect inspect the current network

func (*Network) Remove Uses

func (n *Network) Remove(ctx context.Context) error

Remove removes the current network (from docker engine)

type Networks Uses

type Networks struct {
    // contains filtered or unexported fields
}

Networks holds a list of network

func NetworksFromServices Uses

func NetworksFromServices(cli client.NetworkAPIClient, projectName string, networkConfigs map[string]*config.NetworkConfig, services *config.ServiceConfigs, networkEnabled bool) (*Networks, error)

NetworksFromServices creates a new Networks struct based on networks configurations and services configuration. If a network is defined but not used by any service, it will return an error along the Networks.

func (*Networks) Initialize Uses

func (n *Networks) Initialize(ctx context.Context) error

Initialize make sure network exists if network is enabled

func (*Networks) Remove Uses

func (n *Networks) Remove(ctx context.Context) error

Remove removes networks (clean-up)

Package network imports 11 packages (graph) and is imported by 7 packages. Updated 2017-10-30. Refresh now. Tools for package owners.