id

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package id implements the logic of the ID manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Integer

type Integer interface {
	int | int64 | int32 | int16 | int8 | uint | uint64 | uint32 | uint16 | uint8
}

Integer is the interface that represents an integer.

type Manager

type Manager[T Integer] struct {
	// contains filtered or unexported fields
}

Manager is the struct that manages the Manager.

func GetGeneveTunnelManager

func GetGeneveTunnelManager(ctx context.Context, cl client.Client) *Manager[uint32]

GetGeneveTunnelManager returns the Manager for Geneve tunnels' ids or creates it if not exists. It is a singleton.

func New

func New[T Integer]() *Manager[T]

New returns a new Manager.

func (*Manager[T]) Allocate

func (m *Manager[T]) Allocate(name string) (T, error)

Allocate allocates an ID for the given name.

func (*Manager[T]) Configure

func (m *Manager[T]) Configure(name string, id T) error

Configure configures the Manager with the given name and id. It is used to preallocate IDs already assigned in previous executions.

func (*Manager[T]) Release

func (m *Manager[T]) Release(name string)

Release releases the ID allocated for the given name.

Jump to

Keyboard shortcuts

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