Documentation ¶
Overview ¶
Package snowflake provides utilities for operating on Snowflake IDs. https://en.wikipedia.org/wiki/Snowflake_ID
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
A Generator generates unique IDs. The zero value can be initialized with Init.
func NewGenerator ¶
NewGenerator returns a new generator that uses the given epoch and instance ID.
type ID ¶
type ID int64
ID is a Snowflake ID. It is 63 bits: the most significant bit should never be set (i.e. valid Snowflake IDs are non-negative).
Click to show internal directories.
Click to hide internal directories.