Documentation
¶
Overview ¶
duid means Distributed Unique Id. This package is a framework for generating unique id numbers such that the generation is fast and can be distributed across a network so that no two ids generated from different machines will be the same.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdGenerator ¶
type IdGenerator interface {
NewId() int
}
IdGenerator produce distributed unique ids.
NewId produces the next new id from this IdGenerator.
func NewGenerator ¶
func NewGenerator(uniqueKey uint) IdGenerator
NewGenerator creates a new Generator with the given uniqueKey for generating Ids across a distributed network.
Click to show internal directories.
Click to hide internal directories.