ports

package
v0.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinPort                    = 1
	MaxPort                    = 65535
	MaxPortReservedDuration    = time.Duration(24) * time.Hour
	CleanReservedPortsInterval = time.Hour
)

Variables

View Source
var (
	ErrPortAlreadyUsed = errors.New("port already used")
	ErrPortNotAllowed  = errors.New("port not allowed")
	ErrPortUnAvailable = errors.New("port unavailable")
	ErrNoAvailablePort = errors.New("no available port")
)

Functions

This section is empty.

Types

type PortCtx

type PortCtx struct {
	ProxyName  string
	Port       int
	Closed     bool
	UpdateTime time.Time
}

type PortManager

type PortManager struct {
	// contains filtered or unexported fields
}

func NewPortManager

func NewPortManager(netType string, bindAddr string, allowPorts map[int]struct{}) *PortManager

func (*PortManager) Acquire

func (pm *PortManager) Acquire(name string, port int) (realPort int, err error)

func (*PortManager) Release

func (pm *PortManager) Release(port int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL