Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnknownBackendAddressType refers to an unknown container or unsupported address type ErrUnknownBackendAddressType = errors.New("unknown container address type not supported") // ErrPortMappedForIP refers to a port already mapped to an ip address ErrPortMappedForIP = errors.New("port is already mapped to ip") // ErrPortNotMapped refers to an unmapped port ErrPortNotMapped = errors.New("port is not mapped") )
Functions ¶
This section is empty.
Types ¶
type PortMapper ¶
type PortMapper struct { Allocator *portallocator.PortAllocator // contains filtered or unexported fields }
PortMapper manages the network address translation
func NewWithPortAllocator ¶
func NewWithPortAllocator(allocator *portallocator.PortAllocator) *PortMapper
NewWithPortAllocator returns a new instance of PortMapper which will use the specified PortAllocator
func (*PortMapper) Map ¶
func (pm *PortMapper) Map(container net.Addr, hostIP net.IP, hostPort int, useProxy bool) (host net.Addr, err error)
Map maps the specified container transport address to the host's network address and transport port
func (*PortMapper) SetIptablesChain ¶
func (pm *PortMapper) SetIptablesChain(c *iptables.Chain)
SetIptablesChain sets the specified chain into portmapper
Click to show internal directories.
Click to hide internal directories.