norm

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 1 Imported by: 4

Documentation

Overview

Package norm provides normalization routines for making arbitrary text compatible with Kubernetes's field requirements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyDNSLabelName

func AnyDNSLabelName(raw string) string

AnyDNSLabelName normalizes a raw string so that it conforms to the structure of a DNS label: it must be all lowercase, contain only alphanumeric characters and dashes, and the first and last characters must be alphameric.

func AnyDNSLabelNameSuffixed added in v0.2.0

func AnyDNSLabelNameSuffixed(prefix, suffix string) string

AnyDNSLabelNameSuffixed calls AnyDNSLabelName ensuring that the entirety of the given suffix is retained if possible.

func AnyDNSSubdomainName

func AnyDNSSubdomainName(raw string) string

AnyDNSSubdomainName normalizes a raw string so that it conforms to the structure of a DNS domain: it must be all lowercase; contain only alphanumeric characters, dashes, and dots; and the first and last characters must be alphameric.

func MetaGenerateName

func MetaGenerateName(raw string) string

MetaGenerateName normalizes a Kubernetes metadata generateName field. It is opinionated in that it also forces a dash before the five characters generated by the Kubernetes API.

func MetaName

func MetaName(raw string) string

MetaName normalizes a Kubernetes metadata name field.

func MetaNameSuffixed added in v0.2.0

func MetaNameSuffixed(prefix, suffix string) string

MetaNameSuffixed normalizes a Kubernetes metadata name field ensuring that the entirety of the given suffix is retained if possible.

Types

This section is empty.

Jump to

Keyboard shortcuts

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