Documentation ¶
Overview ¶
Package snowflake provides a very simple Twitter snowflake generator and parser.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID int64
An ID is a custom type used for a snowflake ID. This is used, so we can attach methods onto the ID.
func ParseBase2 ¶
ParseBase2 converts a Base2 string into a snowflake ID
func ParseString ¶
ParseString converts a string into a snowflake ID
func (*ID) Base2 ¶
Base2 returns a string base2 of the snowflake ID
Example ¶
id := gN.Generate() log.Println(id.Base2())
Output:
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
A Node struct holds the basic information needed for a snowflake generator time[node][step]
Click to show internal directories.
Click to hide internal directories.