id

package
v0.0.0-...-d8d42f1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocator

type Allocator interface {
	AllocateID(name string) (int, error)
	ReserveID(name string, id int) error
	ReleaseID(name string)
	ForName(name string) NamedAllocator
}

Allocator of IDs for a set of resources identified by name

func NewIDAllocator

func NewIDAllocator(name string, maxIds int) Allocator

NewIDAllocator returns an IDAllocator

type NamedAllocator

type NamedAllocator interface {
	AllocateID() (int, error)
	ReserveID(int) error
	ReleaseID()
}

NamedAllocator of IDs for a specific resource

Jump to

Keyboard shortcuts

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