snowflake

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Epoch    int64 = 1288834974657
	NodeBits uint8 = 10
	StepBits uint8 = 12
)

Functions

This section is empty.

Types

type ID

type ID int64

func Generate

func Generate() ID

func (ID) Base2

func (f ID) Base2() string

func (ID) Base36

func (f ID) Base36() string

func (ID) Base64

func (f ID) Base64() string

func (ID) Bytes

func (f ID) Bytes() []byte

func (ID) Int64

func (f ID) Int64() int64

func (ID) MD5

func (f ID) MD5() string

func (ID) Node

func (f ID) Node() int64

func (ID) Step

func (f ID) Step() int64

func (ID) String

func (f ID) String() string

func (ID) Time

func (f ID) Time() int64

type Node

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

func NewNode

func NewNode(node int64) (*Node, error)

func (*Node) Generate

func (n *Node) Generate() ID

Jump to

Keyboard shortcuts

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