Versions in this module Expand all Collapse all v1 v1.6.0 Apr 16, 2015 Changes in this version + const DefaultPortRangeEnd + const DefaultPortRangeStart + type PortAllocator struct + Begin int + End int + func New() *PortAllocator + func (p *PortAllocator) ReleaseAll() error + func (p *PortAllocator) ReleasePort(ip net.IP, proto string, port int) error + func (p *PortAllocator) RequestPort(ip net.IP, proto string, port int) (int, error) v1.3.0 Oct 15, 2014 Changes in this version + const BeginPortRange + const EndPortRange + var ErrAllPortsAllocated = errors.New("all ports are allocated") + var ErrUnknownProtocol = errors.New("unknown protocol") + func ReleaseAll() error + func ReleasePort(ip net.IP, proto string, port int) error + func RequestPort(ip net.IP, proto string, port int) (int, error) + type ErrPortAlreadyAllocated struct + func NewErrPortAlreadyAllocated(ip string, port int) ErrPortAlreadyAllocated + func (e ErrPortAlreadyAllocated) Error() string + func (e ErrPortAlreadyAllocated) IP() string + func (e ErrPortAlreadyAllocated) IPPort() string + func (e ErrPortAlreadyAllocated) Port() int