Documentation ¶
Index ¶
Constants ¶
const KindAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
KindAlphabet is the set of characters that can be used as the first character of a TID. The kind has no intrinsic meaning, but can be used to differentiate between different types of ids.
Variables ¶
This section is empty.
Functions ¶
func IsKindAndValid ¶
IsKindAndValid returns true if the TID is a valid TID with the specified kind.
Types ¶
type TID ¶
type TID string
TID is a unique identifier. These are similar to v4 UUIDs, but are shorter and have a different format that includes a kind byte as the first character. TIDs are 17 characters long, are URL safe, and contain 96 bits of entropy.
func FromStringOfKind ¶
FromStringOfKind converts a string to a TID and verifies that it has the specified kind.
func MustNewTID ¶ added in v1.112.0
MustNewTID creates a new TID with a random value and the specified kind. If an error occurs, this function panics.