Documentation
¶
Index ¶
- func WithEpoch(epoch int64) func(*SnowFlake)
- func WithNodeBits(nodeBits uint8) func(*SnowFlake)
- func WithSequenceBits(sequenceBits uint8) func(*SnowFlake)
- type ID
- func ParseBase2(id string) (ID, error)
- func ParseBase32(id string) (ID, error)
- func ParseBase36(id string) (ID, error)
- func ParseBase64(id string) (ID, error)
- func ParseBytes(id []byte) (ID, error)
- func ParseHex(id string) (ID, error)
- func ParseInt64(id int64) ID
- func ParseIntBytes(id [8]byte) (ID, error)
- func ParseString(id string) (ID, error)
- func (id ID) Base2() string
- func (id ID) Base32() string
- func (id ID) Base36() string
- func (id ID) Base64() string
- func (id ID) Bytes() []byte
- func (id ID) Hex() string
- func (id ID) Int64() int64
- func (f ID) IntBytes() [8]byte
- func (id ID) MarshalJSON() ([]byte, error)
- func (id *ID) Scan(src any) error
- func (id ID) String() string
- func (id *ID) UnmarshalJSON(data []byte) error
- func (id ID) Value() (driver.Value, error)
- type Option
- type SnowFlake
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithNodeBits ¶
func WithSequenceBits ¶
Types ¶
type ID ¶
type ID int64
func ParseBase2 ¶
func ParseBase32 ¶
func ParseBase36 ¶
func ParseBase64 ¶
func ParseBytes ¶
func ParseInt64 ¶
func ParseIntBytes ¶
func ParseString ¶
func (ID) MarshalJSON ¶
MarshalJSON encodes the ID as a JSON string to preserve full int64 precision
func (*ID) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.