Versions in this module Expand all Collapse all v1 v1.0.0 Sep 28, 2026 Changes in this version + const EpochMilliseconds + const MaxBucketCount + const MaxNodeID + const MaxSequence + var ErrEpochNotReached = errors.New("sfid: system time is earlier than the epoch") + var ErrInvalidBucketCount = errors.New("sfid: bucket count must be a power of two from 1 through 4096") + var ErrInvalidNodeID = errors.New("sfid: node ID exceeds 10 bits") + var ErrTimestampOverflow = errors.New("sfid: timestamp exceeds 41 bits") + type Generator struct + func New(nodeID uint16) (*Generator, error) + func (g *Generator) Fill(ids []ID) + func (g *Generator) Generate() ID + type ID int64 + func (id ID) Int64() int64 + func (id ID) Node() uint16 + func (id ID) Sequence() uint16 + func (id ID) String() string + func (id ID) Time() time.Time + type Pool struct + func NewPool(nodeID uint16, bucketCount uint) (*Pool, error) + func (p *Pool) Fill(ids []ID) + func (p *Pool) Generate() ID