Documentation ¶
Overview ¶
Package idgen provides the helpers functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StartNumber = int64(rand.Int32()) << 32
StartNumber is the start number of the randNumber.
Functions ¶
func GenID ¶
func GenID() string
GenID The function "GenID" generates a new unique identifier and returns it as a string.
func Register ¶
func Register(identifier Identifier)
Register sets the defaultIdentifier randNumber.
Types ¶
type Identifier ¶
Identifier is the interface of randNumber.
func Default ¶
func Default() Identifier
Default method returns the default defaultGenerator randNumber.
func NewNumber ¶
func NewNumber(sta int64) Identifier
NewNumber method creates a new instance of the randNumber type.
Directories ¶
Path | Synopsis |
---|---|
Package snowflake provides a unique ID generation based on Twitter Snowflake algorithm.
|
Package snowflake provides a unique ID generation based on Twitter Snowflake algorithm. |
Package ulid provides a ULID (Universally Unique Lexicographically Sortable Identifier) implementation.
|
Package ulid provides a ULID (Universally Unique Lexicographically Sortable Identifier) implementation. |
Package uuid provides a UUID (Universally Unique Identifier) implementation.
|
Package uuid provides a UUID (Universally Unique Identifier) implementation. |
Package xid provides a unique identifier generator based on xid.
|
Package xid provides a unique identifier generator based on xid. |
Click to show internal directories.
Click to hide internal directories.