ports

package
v0.52.5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 6 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 Manager added in v0.52.4

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

func NewManager added in v0.52.4

func NewManager(netType string, bindAddr string, allowPorts []types.PortsRange) *Manager

func (*Manager) Acquire added in v0.52.4

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

func (*Manager) Release added in v0.52.4

func (pm *Manager) Release(port int)

type PortCtx

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

Jump to

Keyboard shortcuts

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