nameutil

package
v5.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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