snowflake

package
v0.0.0-...-7de6488 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMachineIDFetcher

func SetMachineIDFetcher(fetcher MachineIDFetcher)

SetMachineIDFetcher set MachineIDFetcher

Types

type MachineIDFetcher

type MachineIDFetcher func() (uint16, error)

MachineIDFetcher function for fetching machine id NOTE: for a distributed system, it's better to register machine into a general center, which make sure the machine id is unique.

type Snowflake

type Snowflake interface {
	NextID() uint64
	NextSID() string
}

Snowflake snow flake id interface

func New

func New() Snowflake

New Snowflake

Jump to

Keyboard shortcuts

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