app

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BitLenTime         = config.GetConfig().Flake.BitsLen.Time         // bit length of time
	BitLenDatacenterID = config.GetConfig().Flake.BitsLen.DatacenterID // bit length of datacenter id
	BitLenMachineID    = config.GetConfig().Flake.BitsLen.MachineID    // bit length of machine id
	BitLenSequence     = config.GetConfig().Flake.BitsLen.Sequence     // bit length of sequence number
	Epoch              = config.GetConfig().Flake.Epoch                // the unix epoch in milliseconds
)

These constants are the bit lengths of Flake ID parts.

Functions

This section is empty.

Types

type Flacker

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

func NewFlacker

func NewFlacker(cfg config.Config) *Flacker

NewFlacker creates a new flacker

func (*Flacker) Decompose

func (f *Flacker) Decompose(uuid uint64) map[string]uint64

Decompose decomposes a UUID into its components

func (*Flacker) NextUUID

func (f *Flacker) NextUUID() uint64

NextUUID returns the next UUID

Jump to

Keyboard shortcuts

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