Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TID ¶
type TID int64
TID is an 63-bit "temporal" ID that is generated from current time and a magic number. 1 million new TIDs can be generated each millisecond, they will run out around year 2262.
func NewTID ¶
New creates a TID from given time and number, N must be a positive integer under 1 million.
type TIDSource ¶
type TIDSource struct {
// contains filtered or unexported fields
}
func NewTIDSource ¶
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.