package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
MaxTime returns the maximum Unix time in milliseconds that can be encoded in an ULID.
Monotonic returns an entropy source that is guaranteed to yield strictly increasing entropy bytes for the same ULID timestamp.
MustNew is a convenience function equivalent to New that panics on failure instead of returning an error.
MustParse is a convenience function equivalent to Parse that panics on failure instead of returning an error.
MustParseStrict is a convenience function equivalent to ParseStrict that panics on failure instead of returning an error.
New returns an ULID with the given Unix milliseconds timestamp and an optional entropy source.
Now is a convenience function that returns the current UTC time in Unix milliseconds.
Parse parses an encoded ULID, returning an error in case of failure.
ParseStrict parses an encoded ULID, returning an error in case of failure.
Time converts Unix milliseconds in the format returned by the Timestamp function to a time.Time.
Timestamp converts a time.Time to Unix milliseconds.
# Constants
EncodedSize is the length of a text encoded ULID.
Encoding is the base 32 encoding alphabet used in ULID strings.
# Variables
ErrBigTime is returned when constructing an ULID with a time that is larger than MaxTime.
ErrBufferSize is returned when marshaling ULIDs to a buffer of insufficient size.
ErrDataSize is returned when parsing or unmarshaling ULIDs with the wrong data size.
ErrInvalidCharacters is returned when parsing or unmarshaling ULIDs with invalid Base32 encodings.
ErrMonotonicOverflow is returned by a Monotonic entropy source when incrementing the previous ULID's entropy bytes would result in overflow.
ErrOverflow is returned when unmarshaling a ULID whose first character is larger than 7, thereby exceeding the valid bit depth of 128.
ErrScanValue is returned when the value passed to scan cannot be unmarshaled into the ULID.
# Structs
MonotonicEntropy is an opaque type that provides monotonic entropy.
# Interfaces
MonotonicReader is an interface that should yield monotonically increasing entropy into the provided slice for all calls with the same ms parameter.
# Type aliases
An ULID is a 16 byte Universally Unique Lexicographically Sortable Identifier
The components are encoded as 16 octets.