Documentation
¶
Overview ¶
Package idm manages reservation/release of numerical ids from a configured set of contiguous ids.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoBitAvailable is returned when no more bits are available to set ErrNoBitAvailable = errors.New("no bit available") // ErrBitAllocated is returned when the specific bit requested is already set ErrBitAllocated = errors.New("requested bit is already allocated") )
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.
An IDM instance is not safe for concurrent use.
func (*IDM) GetSpecificID ¶
GetSpecificID tries to reserve the specified id.
Click to show internal directories.
Click to hide internal directories.