Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitField ¶
type BitField struct {
// contains filtered or unexported fields
}
BitField struct holds a slice of uint64 integers for 64-bit blocks
func NewBitField ¶
NewBitField creates a BitField capable of holding 'n' bits
func (*BitField) NextAvailableBitsInRange ¶
NextAvailableBitsInRange finds the next `n` available (unset) bits within a specified range [start, end). It does not require the bits to be consecutive.
func (*BitField) SetNextAvailableBits ¶
SetNextAvailableBits finds and sets the next `n` available bits, returning their positions. It does not require the bits to be consecutive.
type PortRange ¶
type PortRange struct {
// contains filtered or unexported fields
}
PortRange struct for managing a range of ports with a starting index and fixed size
func NewPortRange ¶
NewPortRange creates a new PortRange with a specified startPort and size
func (*PortRange) AllocateNextPorts ¶
AllocateNextPorts allocates the next `n` available ports in the range. It uses `SetNextAvailableBits` to find non-consecutive available ports.
func (*PortRange) IsPortAllocated ¶
IsPortAllocated checks if a specific port in the range is allocated
func (*PortRange) ReleasePorts ¶
ReleasePorts releases a specified list of ports in the range
func (*PortRange) SetPortAllocated ¶
SetPortAllocated sets a specific port in the range as allocated