nameutil

package
v5.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToFqdnNoDot

func ToFqdnNoDot(s, origin string) string

ToFqdnNoDot is the same as ToFqdnWithDot but the result does not include a trailing ".". Similar to DomainConfig.ToFqdnNoDot() but it takes origin from dc.Name.

func ToFqdnWithDot

func ToFqdnWithDot(s, origin string) string

ToFqdnWithDot converts a shortname to a FQDN+".". ToFqdnWithDot("foo", "bar.com") = "foo.bar.com." // Typical use. ToFqdnWithDot("@", "bar.com") = "bar.com." // Apex returns the apex. ToFqdnWithDot("", "bar.com") = "bar.com." // Apex returns the apex. ToFqdnWithDot("foo.com."," "bar.com") = "foo.com." // FQDNs are unmodified. ToFqdnWithDot("foo", "bar.com.") = "foo.bar.com." // If origin ends with a ".", DTRT. Similar to DomainConfig.ToFqdnWithDot() but it takes origin from dc.Name.

func ToShort

func ToShort(name, origin string) string

ToShort trims origin from name. If name is not below origin, name is returned unchanged. If the name was shortened, it does not end with a ".". If the name was untouched, it ends with a ".". Calling ToShort on a string that is already a shortname is unsupported. Names that do not end with "." are assumed to be FQDNs without a trailing ".". Similar to DomainConfig.ToShort() but you can specify the origin.

Types

This section is empty.

Jump to

Keyboard shortcuts

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