net

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 14 Imported by: 2 modules, 1 package

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

func CreateNetNS

func CreateNetNS(file string) error

func DelNetNS

func DelNetNS(file string) error

func MapPorts

func MapPorts(original *libcni.NetworkConfigList, portMap []PortMapEntry) (cfg *libcni.NetworkConfigList, err error)

func ParsePortMapping

func ParsePortMapping(expr string, r *[]PortMapEntry) (err error)

Types

type ConfigFileGenerator

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

func NewConfigFileGenerator

func NewConfigFileGenerator() ConfigFileGenerator

func (*ConfigFileGenerator) AddCniResult

func (b *ConfigFileGenerator) AddCniResult(r *current.Result)

func (*ConfigFileGenerator) AddDnsNameserver

func (b *ConfigFileGenerator) AddDnsNameserver(dns []string)

func (*ConfigFileGenerator) AddDnsOptions

func (b *ConfigFileGenerator) AddDnsOptions(opts []string)

func (*ConfigFileGenerator) AddDnsSearch

func (b *ConfigFileGenerator) AddDnsSearch(searchSuffix []string)

func (*ConfigFileGenerator) AddHostsEntry

func (b *ConfigFileGenerator) AddHostsEntry(host, ip string)

func (*ConfigFileGenerator) SetDnsDomain

func (b *ConfigFileGenerator) SetDnsDomain(domain string)

func (*ConfigFileGenerator) SetHostname

func (b *ConfigFileGenerator) SetHostname(hostname string)

func (*ConfigFileGenerator) SetMainIP

func (b *ConfigFileGenerator) SetMainIP(ip string)

func (*ConfigFileGenerator) WriteConfigFiles

func (b *ConfigFileGenerator) WriteConfigFiles(rootfs, overlay string) error

type NetConfigs

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

func NewNetConfigs

func NewNetConfigs(confDir string) *NetConfigs

func (*NetConfigs) GetConfig

func (n *NetConfigs) GetConfig(name string) (*libcni.NetworkConfigList, error)

type NetManager

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

func NewNetManager

func NewNetManager(state *specs.State) (r *NetManager, err error)

func (*NetManager) AddNet

func (m *NetManager) AddNet(ifName string, netConf *libcni.NetworkConfigList) (r *current.Result, err error)

Resolves the configured CNI network by name and adds it to the container process' network namespace.

func (*NetManager) DelNet

func (m *NetManager) DelNet(ifName string, netConf *libcni.NetworkConfigList) (err error)

type PortMapEntry

type PortMapEntry struct {
	HostPort      uint16 `json:"hostPort"`
	ContainerPort uint16 `json:"containerPort"`
	Protocol      string `json:"protocol"`
	HostIP        string `json:"hostIP,omitempty"`
}

See https://github.com/containernetworking/plugins/blob/master/plugins/meta/portmap/main.go

func (PortMapEntry) String

func (p PortMapEntry) String() string

Jump to

Keyboard shortcuts

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