Versions in this module Expand all Collapse all v0 v0.0.1 Dec 2, 2023 Changes in this version + var DefaultNode = MustNew() + func NewOptions() *options + func PrintOptions(packageName string) + type ID uint64 + func Alloc(step uint64) (ID, error) + func Gen() (ID, error) + func MustAlloc(step uint64) ID + func MustGen() ID + func (i ID) Base32() string + func (i ID) Base32Lower() string + func (i ID) Hex() string + func (i ID) IsGlobal(n *Node) bool + func (i ID) Node(n *Node) uint64 + func (i ID) Step(n *Node) uint64 + func (i ID) String() string + func (i ID) Time(n *Node) time.Time + func (i ID) Uint64() uint64 + func (i ID) UnixMilli(n *Node) int64 + type Node struct + func MustNew(_opts ...Option) *Node + func New(_opts ...Option) (*Node, error) + func (_n *Node) SetOptions(_opts ...Option) *Node + func (n *Node) Alloc(step uint64) (ID, error) + func (n *Node) Gen() (ID, error) + func (n *Node) MustAlloc(step uint64) ID + func (n *Node) MustGen() ID + func (n *Node) NodeBits() uint8 + func (n *Node) StepBits() uint8 + type Option interface + func SkipOption() Option + func WithEpoch(epoch time.Time) Option + func WithGlobalFlag(globalFlag bool) Option + func WithNode(node uint64) Option + func WithNodeBits(nodeBits uint8) Option + func WithOptions(o *options) Option + func WithStorage(storage Storage) Option + type Storage interface + Get func() (t int64, err error) + Save func(t int64) error