network

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	IP      net.IP
	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, portmappings ...meta.PortMapping) (*Result, error)

	// RemoveContainerNetwork is the method called before a container using the network plugin can be deleted
	RemoveContainerNetwork(containerID string, portmappings ...meta.PortMapping) 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