Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDGenerator ¶ added in v1.2.5
type IDGenerator struct {
// contains filtered or unexported fields
}
IDGenerator generates unique uint64 ID using snowflake algorithm
func MakeGenerator ¶
func MakeGenerator(node string) *IDGenerator
MakeGenerator creates a new IDGenerator
func (*IDGenerator) NextID ¶ added in v1.2.5
func (w *IDGenerator) NextID() int64
NextID returns next unique ID
Click to show internal directories.
Click to hide internal directories.