Documentation ¶
Index ¶
Constants ¶
View Source
const StageName = "port_mapping"
StageName is used to indicate port mapping NAT traversal stage
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MapInterface portmap.Interface MapLifetime time.Duration MapUpdateInterval time.Duration }
Config represents port mapping config.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns default port mapping config.
type PortMapper ¶
type PortMapper interface { // Map maps port for given protocol. It returns release func which // must be called when port no longer needed and ok which is true if // port mapping was successful. Map(id, protocol string, port int, name string) (release func(), ok bool) }
PortMapper tries to map port using router's uPnP or NAT-PMP depending on given config map interface.
func NewNoopPortMapper ¶
func NewNoopPortMapper(publisher eventbus.Publisher) PortMapper
NewNoopPortMapper returns noop port mapper instance.
func NewPortMapper ¶
func NewPortMapper(config *Config, publisher eventbus.Publisher) PortMapper
NewPortMapper returns port mapper instance.
Click to show internal directories.
Click to hide internal directories.