idm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2015 License: Apache-2.0, BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package idm manages resevation/release of numerical ids from a configured set of contiguos 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 contiguos set

func New

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

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

func (*Idm) GetID

func (i *Idm) GetID() (uint32, error)

GetID returns the first available id in the set

func (*Idm) GetSpecificID

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

GetSpecificID tries to reserve the specified id

func (*Idm) Release

func (i *Idm) Release(id uint32)

Release releases the specified id

Jump to

Keyboard shortcuts

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