ports

package
v0.0.0-...-a3dd70e Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveState

func SaveState(filePath string, state State) error

Types

type PoolExhaustedError

type PoolExhaustedError struct{}

func (PoolExhaustedError) Error

func (e PoolExhaustedError) Error() string

type PortPool

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

func NewPool

func NewPool(start, size uint32, state State) (*PortPool, error)

func (*PortPool) Acquire

func (p *PortPool) Acquire() (uint32, error)

func (*PortPool) RefreshState

func (p *PortPool) RefreshState() State

func (*PortPool) Release

func (p *PortPool) Release(port uint32)

func (*PortPool) Remove

func (p *PortPool) Remove(port uint32) error

type PortTakenError

type PortTakenError struct {
	Port uint32
}

func (PortTakenError) Error

func (e PortTakenError) Error() string

type State

type State struct {
	Offset uint32 `json:"offset"`
}

func LoadState

func LoadState(filePath string) (State, error)

type StateFileNotFoundError

type StateFileNotFoundError struct {
	Cause error
}

func (StateFileNotFoundError) Error

func (err StateFileNotFoundError) Error() string

type StateFileNotValidError

type StateFileNotValidError struct {
	Cause error
}

func (StateFileNotValidError) Error

func (err StateFileNotValidError) Error() string

Jump to

Keyboard shortcuts

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