Documentation ¶
Index ¶
- Constants
- Variables
- type Generator
- type ID
- func (i ID) IsZero() bool
- func (i ID) Lowerbound() ID
- func (i ID) MachineID() uint32
- func (i ID) MarshalJSON() (res []byte, e error)
- func (i ID) MarshalText() (res []byte, e error)
- func (i ID) Sequence() uint32
- func (i ID) String() string
- func (i ID) Timestamp() time.Time
- func (i ID) ToSlice() []byte
- func (i *ID) UnmarshalJSON(data []byte) error
- func (i *ID) UnmarshalText(data []byte) error
- func (i ID) Upperbound() ID
- func (i ID) Valid() bool
Constants ¶
View Source
const ( EpochBegin = int64(1704067200000) // 2024-01-01T00:00:00Z SeqShift = 0 SeqMask = uint64(0xFFF) MachineIDShift = 12 MachineIDMask = uint64(0x3FF000) TimestampShift = 22 )
Variables ¶
View Source
var DefaultGenerator = &Generator{}
Functions ¶
This section is empty.
Types ¶
type Generator ¶
func (*Generator) NextAtUnixMilli ¶
type ID ¶
type ID uint64
func (ID) Lowerbound ¶
func (ID) MarshalJSON ¶
func (ID) MarshalText ¶
func (*ID) UnmarshalJSON ¶
func (*ID) UnmarshalText ¶
func (ID) Upperbound ¶
Click to show internal directories.
Click to hide internal directories.