dnsnames

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dnsnames validates the extra internal DNS names an app can claim. Pure functions so the spec, the API and the IaC planner share one rule set.

Index

Constants

View Source
const (
	CodeInvalid  = spec.DNSCodeInvalid
	CodeReserved = "dns_name_reserved"
	CodeConflict = "dns_name_conflict"
)

Frozen error codes, mirrored by internal/iac/codes.go.

Variables

This section is empty.

Functions

func Conflict

func Conflict(names []string, self string, taken map[string]string) error

Conflict reports a name already taken by another app. taken maps a name, either an app name or another app's extra name, to its owner.

func Normalize

func Normalize(names []string, zone string) []string

Normalize delegates to the shared rule in internal/spec.

func ParseReserved

func ParseReserved(csv string) map[string]bool

ParseReserved turns a comma separated setting value into a lookup set.

func Validate

func Validate(names []string, l Limits) error

Validate applies syntax, the setting caps and the reserved list.

func ValidateSyntax

func ValidateSyntax(names []string) error

ValidateSyntax delegates to the shared rule in internal/spec.

Types

type Error

type Error = spec.DNSNameError

Error carries a frozen code so callers can surface it unchanged.

type Limits

type Limits struct {
	MaxNames    int
	MaxLabelLen int
	MaxNameLen  int
	Reserved    map[string]bool
}

Limits are caps read from runtime settings; a zero cap means unchecked.

Jump to

Keyboard shortcuts

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