Documentation
¶
Overview ¶
Package names contains types that represent various types of internet names.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FQDN ¶
type FQDN string
FQDN is a fully-qualified internet domain name.
func (FQDN) IsWithin ¶
IsWithin returns true if n is within the given FQDN.
It returns false if n and f are equal.
func (FQDN) Join ¶
Join returns a name produced by concatenating this name with s. It panics if this name is fully qualified.
func (FQDN) Labels ¶
Labels returns the DNS labels that form this name. It panics if the name is not valid.
func (FQDN) Split ¶
Split splits the first label from the name. If the name only has single label, tail is nil. It panics if the name is not valid.
type Label ¶
type Label string
Label is the part of a DNS name contains within dots.
func (Label) Join ¶
Join returns a name produced by concatenating this name with s. It panics if this name is fully qualified.
func (Label) Qualify ¶
Qualify returns a fully-qualified domain name produced by "qualifying" this name with f.
func (Label) Split ¶
Split splits the "hostname" from the name. If the name does not contain any dots, tail is nil.
type Name ¶
type Name interface { // IsQualified returns true if the name is fully-qualified. IsQualified() bool // Qualify returns a fully-qualified domain name produced by "qualifying" // this name with f. // // If this name is already qualified, it is returned unchanged. Qualify(f FQDN) FQDN // Labels returns the DNS labels that form this name. Labels() []Label // Split splits the first label from the name. // If the name only has single label, tail is nil. Split() (head Label, tail Name) // Join returns a name produced by concatenating this name with s. // It panics if this name is fully qualified. Join(s Name) Name // Validate returns nil if the name is valid. Validate() error // String returns a representation of the name as used by DNS systems. // It panics if the name is not valid. String() string }
Name is an DNS name of some kind.
Any of the methods except Validate() MAY panic if the name is invalid.
type UDN ¶
type UDN string
UDN is a unqualified (relative) domain name that may multiple DNS labels.
func (UDN) Join ¶
Join returns a name produced by concatenating this name with s. It panics if this name is fully qualified.
func (UDN) Labels ¶
Labels returns the DNS labels that form this name. It panics if the name is not valid.
func (UDN) Qualify ¶
Qualify returns a fully-qualified domain name produced by "qualifying" this name with f.
func (UDN) Split ¶
Split splits the first label from the name. If the name only has single label, tail is nil.