Documentation
¶
Overview ¶
Package publicid generates and parses the opaque public_id of every resource (ADR-0008): a type prefix and 12 random characters of Crockford base32 (60 bits) from crypto/rand, written in upper case. Input is read in any case, with O as 0 and I and L as 1, and checked against the prefix the caller expects.
Index ¶
Constants ¶
const Alphabet = "0123456789ABCDEFGHJKMNPQRSTVWXYZ"
Alphabet is Crockford base32: the digits and the upper-case letters without I, L, O and U.
const RandomLength = 12
RandomLength is the number of random characters after the prefix.
Variables ¶
var ErrInvalid = errors.New("invalid public id")
ErrInvalid is wrapped by every error of Parse.
Functions ¶
Types ¶
type Prefix ¶
type Prefix string
Prefix is the type prefix of a public_id, as in the table of api/README.md.
const ( AuditLogEntry Prefix = "AE" AlertGroup Prefix = "AG" AccountLink Prefix = "AK" AccountLinkRequest Prefix = "AR" GatewayCall Prefix = "CA" Connection Prefix = "CN" CheckRun Prefix = "CR" DeliveryEvent Prefix = "DE" Destination Prefix = "DS" EscalationChain Prefix = "EC" EscalationRun Prefix = "ER" GatewayContact Prefix = "GC" LinkRule Prefix = "KR" Note Prefix = "NE" IntegrationToken Prefix = "NK" Integration Prefix = "NT" PersonalToken Prefix = "PT" Organization Prefix = "RG" RequestRecord Prefix = "RQ" Route Prefix = "RT" RotationLayer Prefix = "RY" ServiceAccount Prefix = "SA" Schedule Prefix = "SC" Session Prefix = "SN" User Prefix = "SR" StoredSnapshot Prefix = "SS" ServiceToken Prefix = "ST" LookupTable Prefix = "TB" TimelineEntry Prefix = "TE" Team Prefix = "TM" ScheduleOverride Prefix = "VR" )