idm

package
v24.0.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package idm manages reservation/release of numerical ids from a configured set of contiguous ids

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Idm

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

Idm manages the reservation/release of numerical ids from a contiguous set

func New

func New(ds datastore.DataStore, id string, start, end uint64) (*Idm, error)

New returns an instance of id manager for a [start,end] set of numerical ids

func (*Idm) GetID

func (i *Idm) GetID(serial bool) (uint64, error)

GetID returns the first available id in the set

func (*Idm) GetIDInRange

func (i *Idm) GetIDInRange(start, end uint64, serial bool) (uint64, error)

GetIDInRange returns the first available id in the set within a [start,end] range

func (*Idm) GetSpecificID

func (i *Idm) GetSpecificID(id uint64) error

GetSpecificID tries to reserve the specified id

func (*Idm) Release

func (i *Idm) Release(id uint64)

Release releases the specified id

Jump to

Keyboard shortcuts

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