Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RuntimePortAllocator ¶
type RuntimePortAllocator struct {
// contains filtered or unexported fields
}
RuntimePortAllocator is an allocator resonsible for maintaining port usage information given a user-defined port range. It allocates and releases ports when a port is requested or reclaimed by a runtime.
func GetRuntimePortAllocator ¶
func GetRuntimePortAllocator() (*RuntimePortAllocator, error)
GetRuntimePortAllocator restore the port allocator and gets the global singleton. This should be the only way others access the RuntimePortAllocator and it must be called after SetupRuntimePortAllocator
func (*RuntimePortAllocator) GetAvailablePorts ¶
func (alloc *RuntimePortAllocator) GetAvailablePorts(portNum int) (ports []int, err error)
GetAvailablePorts requests portNum ports from the port allocator. It returns an int array with allocated ports in it.
func (*RuntimePortAllocator) ReleaseReservedPorts ¶
func (alloc *RuntimePortAllocator) ReleaseReservedPorts(ports []int)
ReleaseReservedPorts releases all the ports in the given int array.
Click to show internal directories.
Click to hide internal directories.