Documentation
¶
Overview ¶
Package snowflake ...
Index ¶
Constants ¶
View Source
const ( // Nil is a nil/null snowflake. Nil = ^Snowflake(0) )
Variables ¶
View Source
var (
NodeID = 1
)
Functions ¶
This section is empty.
Types ¶
type Snowflake ¶
type Snowflake uint64
Snowflake represents a snowflake.
Timestamp - 63 to 22 (42 bits) Node ID - 21 to 12 (10 bits) Increment - 11 to 0 (12 bits)
func (Snowflake) MarshalJSON ¶
MarshalJSON satisfies json.Marshaler.
func (*Snowflake) UnmarshalJSON ¶
UnmarshalJSON satisfies json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.