package portallocator
import "github.com/dotcloud/docker/daemon/networkdriver/portallocator"
Index ¶
- Constants
- Variables
- type ErrPortAlreadyAllocated
- 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
- type PortAllocator
Constants ¶
const ( DefaultPortRangeStart = 49153 DefaultPortRangeEnd = 65535 )
Variables ¶
var ( ErrAllPortsAllocated = errors.New("all ports are allocated") ErrUnknownProtocol = errors.New("unknown protocol") )
Types ¶
type ErrPortAlreadyAllocated ¶
type ErrPortAlreadyAllocated struct {
// contains filtered or unexported fields
}
func NewErrPortAlreadyAllocated ¶
func NewErrPortAlreadyAllocated(ip string, port int) ErrPortAlreadyAllocated
func (ErrPortAlreadyAllocated) Error ¶
func (e ErrPortAlreadyAllocated) Error() string
func (ErrPortAlreadyAllocated) IP ¶
func (e ErrPortAlreadyAllocated) IP() string
func (ErrPortAlreadyAllocated) IPPort ¶
func (e ErrPortAlreadyAllocated) IPPort() string
func (ErrPortAlreadyAllocated) Port ¶
func (e ErrPortAlreadyAllocated) Port() int
type PortAllocator ¶
func New ¶
func New() *PortAllocator
func (*PortAllocator) ReleaseAll ¶
func (p *PortAllocator) ReleaseAll() error
ReleaseAll releases all ports for all ips.
func (*PortAllocator) ReleasePort ¶
ReleasePort releases port from global ports pool for specified ip and proto.
func (*PortAllocator) RequestPort ¶
RequestPort requests new port from global ports pool for specified ip and proto. If port is 0 it returns first free port. Otherwise it cheks port availability in pool and return that port or error if port is already busy.
Source Files ¶
- Version
- v1.6.0-rc7
- Published
- Apr 15, 2015
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 1 second ago –
Tools for package owners.