dnslabel

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package dnslabel normalizes arbitrary strings into DNS-label-safe path segments. Shard ingress paths are assembled from these segments in two independent places — the cardinal-operator (the Ingress path it programs) and pkg/cluster (the URL used to address a shard through Traefik) — and the two MUST produce identical segments or shard requests 404. This package is the single source of that normalization so those callers can't drift apart.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCanonical

func IsCanonical(value string) bool

IsCanonical reports whether value is already in Sanitize's normal form.

func Sanitize

func Sanitize(value string) string

Sanitize lowercases value and collapses every run of non-alphanumeric characters into a single hyphen, trimming leading and trailing hyphens. Empty or all-invalid input yields "unknown" so a path segment is never empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL