Documentation
¶
Overview ¶
Package id provides the primary identifier type for all ctrlplane entities. It wraps go.jetify.com/typeid to provide prefix-qualified, globally unique, sortable, URL-safe IDs in the format "prefix_suffix" (e.g., "inst_01h455vb4pex5vsknk084sn02q").
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID is the primary identifier type for all ctrlplane entities. It wraps a TypeID providing a prefix-qualified, globally unique, sortable, URL-safe identifier in the format "prefix_suffix".
var Nil ID
Nil is the zero-value ID.
func MustParseWithPrefix ¶
MustParseWithPrefix is like ParseWithPrefix but panics on error. Use for hardcoded ID values.
func New ¶
New generates a new globally unique ID with the given prefix. It panics if prefix is not a valid TypeID prefix (programming error).
func Parse ¶
Parse parses a TypeID string (e.g., "inst_01h455vb4pex5vsknk084sn02q") into an ID. Returns an error if the string is not valid.
func ParseWithPrefix ¶
ParseWithPrefix parses a TypeID string and validates that its prefix matches the expected value.
func (ID) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (ID) String ¶
String returns the full TypeID string representation (prefix_suffix). Returns an empty string for the Nil ID.
func (*ID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Prefix ¶
type Prefix string
Prefix identifies the entity type encoded in a TypeID.
const ( PrefixInstance Prefix = "inst" PrefixDeployment Prefix = "dep" PrefixRelease Prefix = "rel" PrefixHealthCheck Prefix = "chk" PrefixHealthResult Prefix = "hres" PrefixDomain Prefix = "dom" PrefixRoute Prefix = "rte" PrefixCertificate Prefix = "cert" PrefixSecret Prefix = "sec" PrefixWebhook Prefix = "hook" PrefixWebhookDelivery Prefix = "deli" PrefixTenant Prefix = "ten" PrefixAuditEntry Prefix = "aud" PrefixEvent Prefix = "evt" )
Prefix constants for all ctrlplane entity types.