uid64

package module
v0.0.0-...-c6f460d Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

uid64

Unique 64 bit ID generator time sortable for distributed system

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidState     = errors.New("the system clock is invalid")
	ErrOutOfBoundNodeID = fmt.Errorf("nodeID must be between 0 and %d", maxNodeID)
)

Functions

This section is empty.

Types

type Generator

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

func New

func New() *Generator

func NewWithNodeID

func NewWithNodeID(nodeID int) (*Generator, error)

func (*Generator) NextID

func (g *Generator) NextID() (int64, error)

Jump to

Keyboard shortcuts

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