id

package
v0.0.0-...-93368d4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2015 License: MIT Imports: 3 Imported by: 6

Documentation

Overview

Package id implementes an entity id generator.

Thanks to #mcdevs from Freenode, especially TkTech for the idea.

Index

Constants

This section is empty.

Variables

View Source
var DefaultGenerator = new(Generator)

Functions

func Get

func Get() int32

func Rel

func Rel(id int32)

Types

type Generator

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

Generator returns numbers, not necessarily sequential, within the range: [0, 1<<31-1].

func (*Generator) Get

func (g *Generator) Get() int32

Get gets a free id.

func (*Generator) Rel

func (g *Generator) Rel(id int32)

Rel releases an id back to the generator.

Jump to

Keyboard shortcuts

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