portallocator

package
v0.0.0-...-a8331be Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocatePortsParams

type AllocatePortsParams struct {
	Count   uint   `json:"count"`
	Network string `json:"network"`
}

type AllocatedPortRange

type AllocatedPortRange struct {
	From  uint `json:"from"`
	Count uint `json:"count"`
}

type AllocationErrorKind

type AllocationErrorKind = string
const NO_ALLOCATABLE_RANGES AllocationErrorKind = "NO_ALLOCATABLE_RANGES"

type AllowedPorts

type AllowedPorts struct {
	From uint `json:"from"`
	To   uint `json:"to"`
}

func (AllowedPorts) IsAllowed

func (a AllowedPorts) IsAllowed(pr AllocatedPortRange) bool

type PortAllocationError

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

func (*PortAllocationError) Error

func (e *PortAllocationError) Error() string

type PortAllocator

type PortAllocator struct{}

func (*PortAllocator) AllocatePortRange

func (p *PortAllocator) AllocatePortRange(ctx restate.ObjectContext, params AllocatePortsParams) (*AllocatedPortRange, error)

func (*PortAllocator) FreePortsForNetwork

func (p *PortAllocator) FreePortsForNetwork(ctx restate.ObjectContext, network string) error

func (*PortAllocator) Initialize

func (p *PortAllocator) Initialize(ctx restate.ObjectContext, allowedPorts AllowedPorts) error

Jump to

Keyboard shortcuts

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