Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ULID ¶
type ULID struct {
// contains filtered or unexported fields
}
A ULID is a 6-byte timestamp (encoded to 10 chars) and a 10-byte nonce (encoded to 16 chars). Those are the facts.
var ( // Nil as empty value to handle errors Nil ULID )
func Decode ¶
Decode takes a ULID string and returns a ULID containing its constitutent parts (time and nonce)
Returns Nil and an error if the string is malformed or the wrong length
func Unique ¶
func Unique() ULID
Unique returns a unique ULID with the current time
We panic in the unlikely event that we are unable to obtain a nonce number.
func (ULID) MarshalJSON ¶
MarshalJSON serializes a ULID as its string representation
func (*ULID) UnmarshalJSON ¶
UnmarshalJSON deserializes a ULID from its string representation
Time will be standardized to UTC.
Click to show internal directories.
Click to hide internal directories.