Versions in this module Expand all Collapse all v0 v0.1.3 Dec 16, 2019 Changes in this version + const Epoch + const MaxSequence + const MaxTimestamp + const SizeBinary + const SizeEncoded + const TimeUnit + func Sort(s []ID) + type Generator struct + func NewGenerator(snapshot *GeneratorSnapshot, c chan<- *SequenceOverflowNotification) (*Generator, error) + func (g *Generator) Cap() int + func (g *Generator) Len() int + func (g *Generator) New(meta byte) (id ID) + func (g *Generator) NewWithTime(meta byte, t time.Time) (id ID) + func (g *Generator) Partition() Partition + func (g *Generator) Sequence() uint32 + func (g *Generator) SequenceMax() uint16 + func (g *Generator) SequenceMin() uint16 + func (g *Generator) Snapshot() GeneratorSnapshot + type GeneratorSnapshot struct + Drifts uint32 + Now int64 + Partition Partition + Sequence uint32 + SequenceMax uint16 + SequenceMin uint16 + WallHi int64 + WallSafe int64 + type ID [SizeBinary]byte + func FromBinaryBytes(src []byte) (id ID, err error) + func FromEncodedBytes(src []byte) (id ID, err error) + func FromEncodedString(src string) (id ID, err error) + func New(meta byte) ID + func NewWithTime(meta byte, t time.Time) ID + func Zero() ID + func (id *ID) Scan(value interface{}) error + func (id *ID) UnmarshalBinary(src []byte) error + func (id *ID) UnmarshalJSON(src []byte) error + func (id *ID) UnmarshalText(src []byte) error + func (id ID) Bytes() []byte + func (id ID) Compare(that ID) int + func (id ID) IsZero() bool + func (id ID) MarshalBinary() ([]byte, error) + func (id ID) MarshalJSON() ([]byte, error) + func (id ID) MarshalText() ([]byte, error) + func (id ID) Meta() byte + func (id ID) Partition() Partition + func (id ID) Sequence() uint16 + func (id ID) String() string + func (id ID) Time() time.Time + func (id ID) Timestamp() int64 + func (id ID) Value() (driver.Value, error) + type InvalidDataSizeError struct + func (e *InvalidDataSizeError) Error() string + type InvalidSequenceBoundsError struct + Cur uint32 + Max uint16 + Min uint16 + Msg string + func (e *InvalidSequenceBoundsError) Error() string + type InvalidTypeError struct + Value interface{} + func (e *InvalidTypeError) Error() string + type Partition [2]byte + func (p *Partition) PutUint16(u uint16) + func (p Partition) AsUint16() uint16 + type SequenceOverflowNotification struct + Count uint32 + Now time.Time + Ticks uint32