Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDGenerator ¶
IDGenerator contains the structure of the id generator. IDs are comprised of a similar structure to instagram where 41 bits contain the timestamp then a further 23 bits for a shard and sequence.
func NewIDGenerator ¶
func NewIDGenerator(initialEpoch int64, shardID int64) *IDGenerator
NewIDGenerator returns an IDGenerator.
func (*IDGenerator) GenerateID ¶
func (id *IDGenerator) GenerateID() int64
GenerateID returns a new id that is int64.
Click to show internal directories.
Click to hide internal directories.