ports

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 11

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.34.0

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

func NewManager added in v0.34.0

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

func (*Manager) Acquire added in v0.34.0

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

func (*Manager) Release added in v0.34.0

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