dnsname

package
v0.0.0-...-823a405 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Name

type Name struct {
	// contains filtered or unexported fields
}

Name represents a valid DNS resource name. +kubebuilder:validation:Type=string

func NewName

func NewName(name string) (*Name, error)

NewName validates the given domain name and constructs a new Name. The domain name can be either be fully qualified or not.

func (*Name) IsChildOf

func (name *Name) IsChildOf(parent *Name) bool

IsChildOf returns `true` if this domain name is a child of the given parent name. A domain is a child of another one if the latter is a suffix of the former. Note: this method ignores the final dot of a FQDN.

func (*Name) IsFQDN

func (name *Name) IsFQDN() bool

IsFQDN return `true` when the domain name is a Fully Qualified Domain Name (i.e., it ends with a dot).

func (*Name) IsRoot

func (name *Name) IsRoot() bool

IsRoot returns `true` when the domain name is the root domain ".".

func (*Name) MarshalJSON

func (name *Name) MarshalJSON() ([]byte, error)

MarshalJSON saves the JSON representation of this domain name.

func (*Name) String

func (name *Name) String() string

String returns a string representation of this domain name.

func (*Name) ToFQDN

func (name *Name) ToFQDN() *Name

ToFQDN makes this domain name fully qualified.

func (*Name) UnmarshalJSON

func (name *Name) UnmarshalJSON(data []byte) error

UnmarshalJSON parses the given JSON data as a domain name.

Jump to

Keyboard shortcuts

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