snowflake

package
v0.5.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Epoch int64 = 1288834974657
)

Variables

View Source
var (
	NodeBits uint8 = 10
	StepBits uint8 = 12
)

Functions

This section is empty.

Types

type ID

type ID int64

func ParseBase64

func ParseBase64(id string) (ID, error)

func ParseBytes

func ParseBytes(id []byte) (ID, error)

func ParseInt64

func ParseInt64(id int64) ID

func (ID) Base64

func (i ID) Base64() string

func (ID) Bytes

func (i ID) Bytes() []byte

func (ID) Int64

func (i ID) Int64() int64

func (ID) ProtoMessage

func (i ID) ProtoMessage() *pb.Snowflake

func (ID) String

func (i ID) String() string

type Node

type Node interface {
	Generate() ID
}

func New

func New(id int64) (Node, error)

Jump to

Keyboard shortcuts

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