snowflake

package
v0.0.0-...-88f351d Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT, CC-BY-4.0, MIT, + 1 more 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

Jump to

Keyboard shortcuts

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