snowflake

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENCODEBASE32MAP = "ybndrfg8ejkmcpqxot1uwisza345h769"
	ENCODEBASE58MAP = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
)

Variables

View Source
var (
	Epoch int64 = 1288834974657

	NodeBits uint8 = 10

	StepBits uint8 = 12

	ErrInvalidBase58 = errors.New("invalid base58")
	ErrInvalidBase32 = errors.New("invalid base32")
)

Functions

This section is empty.

Types

type ID

type ID int64

func (ID) Int64

func (id ID) Int64() int64

func (ID) String

func (id ID) String() string

type JSONSyntaxError

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

func (JSONSyntaxError) Error

func (j JSONSyntaxError) Error() string

type Node

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

func NewNode

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

func (*Node) Generate

func (node *Node) Generate() ID

Jump to

Keyboard shortcuts

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