package idm

import "github.com/docker/libnetwork/idm"

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

Index

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 uint64) (*Idm, error)

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

func (*Idm) GetID

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

GetID returns the first available id in the set

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

Source Files

idm.go

Version
v0.5.6 (latest)
Published
Jan 15, 2016
Platform
linux/amd64
Imports
3 packages
Last checked
2 hours ago

Tools for package owners.