snowflake

package
Version: v0.0.0-...-978c921 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: MIT, CC-BY-4.0, MIT, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Clock = func() time.Time { return time.Now() }
View Source
var Epoch = time.Date(2014, 12, 0, 0, 0, 0, 0, time.UTC)
View Source
var SeqCounter uint64

Functions

This section is empty.

Types

type Snowflake

type Snowflake uint64

func New

func New() (Snowflake, error)

func NewFromString

func NewFromString(s string) (Snowflake, error)

func NewFromTime

func NewFromTime(t time.Time) Snowflake

func (Snowflake) Before

func (s Snowflake) Before(reference Snowflake) bool

func (*Snowflake) FromString

func (s *Snowflake) FromString(str string) error

func (Snowflake) GoString

func (s Snowflake) GoString() string

func (Snowflake) IsZero

func (s Snowflake) IsZero() bool

func (Snowflake) MarshalJSON

func (s Snowflake) MarshalJSON() ([]byte, error)

func (Snowflake) String

func (s Snowflake) String() string

func (Snowflake) Time

func (s Snowflake) Time() time.Time

func (*Snowflake) UnmarshalJSON

func (s *Snowflake) UnmarshalJSON(data []byte) error

type Snowflaker

type Snowflaker interface {
	Next() (uint64, error)
}
var DefaultSnowflaker Snowflaker

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL