snowflake

package
v0.0.0-...-93c743e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDGenerator

type IDGenerator struct {
	// contains filtered or unexported fields
}

IDGenerator generate unique id

func NewIDGenerator

func NewIDGenerator(nodeID int64) (*IDGenerator, error)

NewIDGenerator NewIDGenerator

func (*IDGenerator) Next

func (g *IDGenerator) Next() snowflake.ID

Next Generate a new id

func (*IDGenerator) Parse

func (g *IDGenerator) Parse(id int64) snowflake.ID

func (*IDGenerator) ParseBase36

func (g *IDGenerator) ParseBase36(id string) (snowflake.ID, error)

ParseBase36 ParseBase36

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL