snowflake

package
v0.0.0-...-3d3caa2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_EPOCH     = 1577808000000
	DEFAULT_NODE_BITS = 12
	DEFAULT_STEP_BITS = 13
)

Variables

This section is empty.

Functions

func GenID

func GenID() string

func GenInt64

func GenInt64() int64

func Init

func Init(nodeId int32)

func NowMS

func NowMS() int64

Types

type Node

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

func NewNode

func NewNode(id int64, epoch int64, nodeBits uint8, stepBits uint8) (*Node, error)

func (*Node) GenID

func (n *Node) GenID() int64

func (*Node) Start

func (n *Node) Start()

Jump to

Keyboard shortcuts

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