Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultNodeNumber = int64(1) // Number range from 0 to 1023.
DefaultNodeNumber is the default node number used to initialize the ID Generator.
Functions ¶
func Default ¶
func Default() ident.Identifier
Default returns the global Snowflake ID Generator instance.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator represents a Snowflake-based ID Generator.
func New ¶
New creates a new Snowflake Generator with the specified node number. It returns a pointer to the Generator and an error if any.
Click to show internal directories.
Click to hide internal directories.