Documentation ¶
Overview ¶
Package idpool implements a reusable integer id pool.
Example
pool := idpool.New(5,1024) pool.Allocate() // 5 pool.Allocate() // 6 pool.Allocate(5) pool.Allocate() // 5
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is the id pool.
func New ¶
New returns a new Pool for given range. Range [low,high) is left open and right closed. Setting high to 0 means high is MaxInt32.
Click to show internal directories.
Click to hide internal directories.