idgenerator

package
v0.0.0-...-5990362 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: GPL-3.0 Imports: 4 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 generates unique uint64 ID using snowflake algorithm

func MakeGenerator

func MakeGenerator(node string) *IDGenerator

MakeGenerator creates a new IDGenerator

func (*IDGenerator) NextID

func (w *IDGenerator) NextID() int64

NextID returns next unique ID

Jump to

Keyboard shortcuts

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