network

package
v0.0.0-...-81244f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2016 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerFactory

type DockerFactory struct {
	ClientFactory composeclient.Factory
}

DockerFactory implements project.NetworksFactory

func (*DockerFactory) Create

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

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

Network holds attributes and method for a network definition in compose

func NewNetwork

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

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

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

Inspect inspect the current network

func (*Network) Remove

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

Remove removes the current network (from docker engine)

type Networks

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

Networks holds a list of network

func NetworksFromServices

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

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

Initialize make sure network exists if network is enabled

func (*Networks) Remove

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

Remove removes networks (clean-up)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL