Documentation ¶
Index ¶
- func AddPortMapping(logger lager.Logger, configStore ConfigStore, handle string, ...) error
- func New(specParser SpecParser, subnetPool subnets.Pool, configCreator ConfigCreator, ...) *networker
- func NewConfigurer(resolvConfigurer DnsResolvConfigurer, hostConfigurer HostConfigurer, ...) *configurer
- func ParseSpec(spec string) (subnets.SubnetSelector, subnets.IPSelector, error)
- type ConfigCreator
- type ConfigStore
- type Configurer
- type ContainerConfigurer
- type Creator
- type DnsResolvConfigurer
- type FileWriter
- type FirewallOpener
- type HostConfigurer
- type HostFileCompiler
- type IDGenerator
- type IdMapReader
- type InstanceChainCreator
- type NetnsExecer
- type NetworkConfig
- type Networker
- type PortForwarder
- type PortForwarderSpec
- type PortPool
- type ResolvConfigurer
- type ResolvFileCompiler
- type RootIdMapReader
- type SpecParser
- type SpecParserFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPortMapping ¶
func AddPortMapping(logger lager.Logger, configStore ConfigStore, handle string, newMapping garden.PortMapping) error
func New ¶
func New( specParser SpecParser, subnetPool subnets.Pool, configCreator ConfigCreator, configStore ConfigStore, configurer Configurer, portPool PortPool, portForwarder PortForwarder, firewallOpener FirewallOpener, ) *networker
func NewConfigurer ¶
func NewConfigurer(resolvConfigurer DnsResolvConfigurer, hostConfigurer HostConfigurer, containerConfigurer ContainerConfigurer, instanceChainCreator InstanceChainCreator) *configurer
func ParseSpec ¶
func ParseSpec(spec string) (subnets.SubnetSelector, subnets.IPSelector, error)
Types ¶
type ConfigCreator ¶
type ConfigStore ¶
type Configurer ¶
type Configurer interface { Apply(log lager.Logger, cfg NetworkConfig, pid int) error DestroyBridge(log lager.Logger, cfg NetworkConfig) error DestroyIPTablesRules(log lager.Logger, cfg NetworkConfig) error }
type ContainerConfigurer ¶
type ContainerConfigurer interface {
Apply(logger lager.Logger, cfg NetworkConfig, pid int) error
}
type Creator ¶
type Creator struct {
// contains filtered or unexported fields
}
func NewConfigCreator ¶
type DnsResolvConfigurer ¶
type DnsResolvConfigurer interface {
Configure(log lager.Logger, cfg NetworkConfig, pid int) error
}
type FileWriter ¶
type FirewallOpener ¶
type HostConfigurer ¶
type HostConfigurer interface { Apply(logger lager.Logger, cfg NetworkConfig, pid int) error Destroy(cfg NetworkConfig) error }
type HostFileCompiler ¶
type IDGenerator ¶
type IDGenerator interface {
Generate() string
}
func NewSequentialIDGenerator ¶
func NewSequentialIDGenerator(seed int64) IDGenerator
type IdMapReader ¶
type InstanceChainCreator ¶
type NetworkConfig ¶
type Networker ¶
type Networker interface { Capacity() uint64 Network(log lager.Logger, spec garden.ContainerSpec, pid int) error Destroy(log lager.Logger, handle string) error NetIn(log lager.Logger, handle string, externalPort, containerPort uint32) (uint32, uint32, error) NetOut(log lager.Logger, handle string, rule garden.NetOutRule) error BulkNetOut(log lager.Logger, handle string, rules []garden.NetOutRule) error Restore(log lager.Logger, handle string) error }
type PortForwarder ¶
type PortForwarder interface {
Forward(spec PortForwarderSpec) error
}
type PortForwarderSpec ¶
type ResolvConfigurer ¶
type ResolvConfigurer struct { HostsFileCompiler HostFileCompiler ResolvFileCompiler ResolvFileCompiler FileWriter FileWriter IDMapReader IdMapReader }
func (*ResolvConfigurer) Configure ¶
func (d *ResolvConfigurer) Configure(log lager.Logger, cfg NetworkConfig, pid int) error
type ResolvFileCompiler ¶
type RootIdMapReader ¶
type RootIdMapReader struct{}
func (*RootIdMapReader) ReadRootId ¶
func (r *RootIdMapReader) ReadRootId(path string) (int, error)
Reads /proc/<pid>/{uid_map|gid_map} and retrieves the mapped user id for the container root user. Map format is the following: containerId hostId mappingSize 0 1000 1
type SpecParser ¶
type SpecParser interface {
Parse(log lager.Logger, spec string) (subnets.SubnetSelector, subnets.IPSelector, error)
}
type SpecParserFunc ¶
type SpecParserFunc func(spec string) (subnets.SubnetSelector, subnets.IPSelector, error)
func (SpecParserFunc) Parse ¶
func (fn SpecParserFunc) Parse(log lager.Logger, spec string) (subnets.SubnetSelector, subnets.IPSelector, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
iptablesfakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
The subnets package provides a subnet pool from which networks may be dynamically acquired or statically reserved.
|
The subnets package provides a subnet pool from which networks may be dynamically acquired or statically reserved. |
fake_subnet_pool
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
subnetsfakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
Click to show internal directories.
Click to hide internal directories.