network

package
v0.5.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActivePlugin = PluginDockerBridge

ActivePlugin is set at runtime to the plugin that is chosen to be active. The default mode is docker-bridge

Functions

This section is empty.

Types

type Address

type Address struct {
	net.IPNet
	Gateway net.IP
}

type Plugin

type Plugin interface {
	// Name returns the network plugin's name.
	Name() PluginName

	// PrepareContainerSpec sets any needed options on the container spec before starting the container
	PrepareContainerSpec(container *runtime.ContainerConfig) error

	// SetupContainerNetwork sets up the networking for a container
	// This is ran _after_ the container has been started
	SetupContainerNetwork(containerID string) (*Result, error)

	// RemoveContainerNetwork is the method called before a container using the network plugin can be deleted
	RemoveContainerNetwork(containerID string) error

	// Status returns error if the network plugin is in error state
	Status() error
}

Plugin describes a generic network plugin

type PluginName

type PluginName string

PluginName defines a name for a network plugin

const (
	// PluginCNI specifies the network mode where CNI is used
	PluginCNI PluginName = "cni"
	// PluginDockerBridge specifies the default docker bridge network is used
	PluginDockerBridge PluginName = "docker-bridge"
)

func ListPlugins

func ListPlugins() []PluginName

ListPlugins gets the list of available network plugins

func (PluginName) String

func (pn PluginName) String() string

type Result

type Result struct {
	Addresses []Address
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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