Documentation ¶
Index ¶
- func CreateNetNS(file string) error
- func DelNetNS(file string) error
- func MapPorts(original *libcni.NetworkConfigList, portMap []PortMapEntry) (*libcni.NetworkConfigList, error)
- func ParsePortMapping(expr string, r *[]PortMapEntry) (err error)
- type ConfigFileGenerator
- func (b *ConfigFileGenerator) AddCniResult(r *current.Result)
- func (b *ConfigFileGenerator) AddDnsNameserver(dns []string)
- func (b *ConfigFileGenerator) AddDnsOptions(opts []string)
- func (b *ConfigFileGenerator) AddDnsSearch(searchSuffix []string)
- func (b *ConfigFileGenerator) AddHostsEntry(host, ip string)
- func (b *ConfigFileGenerator) SetDnsDomain(domain string)
- func (b *ConfigFileGenerator) SetHostname(hostname string)
- func (b *ConfigFileGenerator) SetMainIP(ip string)
- func (b *ConfigFileGenerator) WriteConfigFiles(rootfs string) error
- type NetConfigs
- type NetManager
- type PortMapEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNetNS ¶
func MapPorts ¶
func MapPorts(original *libcni.NetworkConfigList, portMap []PortMapEntry) (*libcni.NetworkConfigList, 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 string) error
type NetConfigs ¶
type NetConfigs struct {
// contains filtered or unexported fields
}
func NewNetConfigs ¶
func NewNetConfigs(confDir string) (*NetConfigs, error)
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
Click to show internal directories.
Click to hide internal directories.