Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DEFAULT_EPOCH int64 = 1640995200000 // Jan 1, 2022
View Source
var VALID_PREFIX = regexp.MustCompile(`^[a-z0-9_]+$`)
Functions ¶
func ComputeNodeID ¶
func ComputeNodeID() int
Types ¶
type DecodedPika ¶
type DeconstructedSnowflake ¶
type Pika ¶
type Pika struct {
Prefixes map[string]PikaPrefixDefinition
Epoch int64
NodeID int
DisableLowercase bool
// contains filtered or unexported fields
}
func NewPika ¶
func NewPika(prefixes []PikaPrefixDefinition, opts PikaInitOptions) *Pika
type PikaInitOptions ¶
type PikaPrefixDefinition ¶
type Snowflake ¶
func NewSnowflake ¶
func (*Snowflake) Deconstruct ¶
func (s *Snowflake) Deconstruct(id string) *DeconstructedSnowflake
func (*Snowflake) GenWithTimestamp ¶
Click to show internal directories.
Click to hide internal directories.