Documentation
¶
Overview ¶
Package slug derives DNS-1123-compatible identifiers from free-text display names, with deterministic collision suffixes.
Index ¶
Constants ¶
View Source
const MaxLen = 63
Variables ¶
This section is empty.
Functions ¶
func From ¶
From slugifies a free-text display name. Lowercases, replaces runs of non-[a-z0-9] with a single dash, trims leading/trailing dashes, truncates to MaxLen. Returns "" when the input has no usable characters; callers should treat empty as an error.
func Unique ¶
Unique returns base if exists(base) is false; otherwise base-2, base-3, … until exists returns false. Callers own the uniqueness scope (per-kind index).
func WithSuffix ¶
WithSuffix appends "-N" to base, ensuring the result fits in MaxLen by trimming base. N ≥ 2 (callers iterate from 2).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.