util

package
v0.2.1-0...-d023f04 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnsEpoch = uint32(1490595737)
)

http://sumory.com/2014/02/15/id-generator/

Variables

This section is empty.

Functions

This section is empty.

Types

type IdWorker

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

func NewIdWorker

func NewIdWorker(workerId, datacenterId uint32, snsEpoch uint32) (*IdWorker, error)

NewIdWorker new a snowflake id generator object.

func (*IdWorker) NextId

func (id *IdWorker) NextId() (uint32, error)

NextId get a snowflake id.

Jump to

Keyboard shortcuts

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