Documentation
¶
Index ¶
- Constants
- type Salt
- type TID
- func (t *TID) ApplyRawValue(v int64)
- func (t TID) Bytes() []byte
- func (t TID) IsVirtual() bool
- func (t TID) IsZero() bool
- func (t TID) MarshalJSON() ([]byte, error)
- func (t TID) RawValue() int64
- func (t *TID) Scan(value any) error
- func (t TID) Serial() int64
- func (t TID) String() string
- func (t TID) Time() time.Time
- func (t *TID) UnmarshalJSON(b []byte) error
- func (t TID) Value() (driver.Value, error)
- type TIDSource
- type UID
Constants ¶
View Source
const ( MaxTIDSerialN = tidCounterMax - 1 MaxTIDSerialBatch = tidTimeMax - 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TID ¶
type TID struct {
// contains filtered or unexported fields
}
TID is an 63-bit "temporal" ID that is generated from current time and a magic numbers.
func NewRawValueTID ¶
func NewSerialTID ¶
func ParseTIDBytes ¶
ParseTIDBytes converts raw bytes into a TID.
func (*TID) ApplyRawValue ¶
func (TID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*TID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type UID ¶
type UID struct {
// contains filtered or unexported fields
}
UID is a 120-bit (15 byte) "content ID" for arbitrary binary data, with collision chance of 1 in ~2.66 trillion on trillion unique items.
func ParseUIDBytes ¶
func (UID) Hex ¶
Hex returns a hex encoded presentation of a ID. This should be used when using IDs as filenames on case-insensitive filesystems.
func (UID) MarshalJSON ¶
func (*UID) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.