Documentation ¶
Overview ¶
Package domain parses DNS domain names.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortDomains ¶
func SortDomains(s []Domain)
SortDomains sorts a list of domains according to their ASCII representations.
func StringToASCII ¶ added in v1.7.2
StringToASCII normalizes a domain with best efforts, ignoring errors.
Types ¶
type Domain ¶
type Domain interface { // DNSNameASCII gives a name suitable for accessing the Cloudflare API DNSNameASCII() string // Describe gives the most human-readable domain name that is still unambiguous Describe() string // Split gives a Splitter that can be used to find zones Split() Splitter }
A Domain represents a domain name to update.
type FQDN ¶
type FQDN string
FQDN is a fully qualified domain in its ASCII form.
func (FQDN) DNSNameASCII ¶
DNSNameASCII retruns the ASCII form of the FQDN.
type FQDNSplitter ¶
type FQDNSplitter struct {
// contains filtered or unexported fields
}
FQDNSplitter implements Splitter for a FQDN.
func (*FQDNSplitter) IsValid ¶
func (s *FQDNSplitter) IsValid() bool
IsValid checks whether the cursor is still valid.
func (*FQDNSplitter) Next ¶
func (s *FQDNSplitter) Next()
Next moves the cursor to the next spltting point. Call [IsValid] to check whether the resulting cursor is valid.
func (*FQDNSplitter) ZoneNameASCII ¶
func (s *FQDNSplitter) ZoneNameASCII() string
ZoneNameASCII gives the ASCII form of the current zone suffix.
type Splitter ¶
type Splitter interface { // IsValid checks whether the cursor is still valid. IsValid() bool // ZoneNameASCII gives the suffix after the cursor as a possible zone, if the cursor is still valid. ZoneNameASCII() string // Next moves the cursor to the next possible splitting point, which might end up being invalid. Next() }
A Splitter enumerates all possible zones of a domain by moving a cursor from the start of the domain's name to its end.
type Wildcard ¶
type Wildcard string
Wildcard is a fully qualified zone name in its ASCII form, represnting the wildcard domain name under the zone. For example, Wildcard("example.org") represents *.example.org.
func (Wildcard) DNSNameASCII ¶
DNSNameASCII retruns the ASCII form of the wildcard domain.
type WildcardSplitter ¶
type WildcardSplitter struct {
// contains filtered or unexported fields
}
WildcardSplitter implements Splitter for a wildcard domain.
func (*WildcardSplitter) IsValid ¶
func (s *WildcardSplitter) IsValid() bool
IsValid checks whether the cursor is still valid.
func (*WildcardSplitter) Next ¶
func (s *WildcardSplitter) Next()
Next moves the cursor to the next spltting point. Call WildcardSplitter.IsValid to check whether the resulting cursor is valid.
func (*WildcardSplitter) ZoneNameASCII ¶
func (s *WildcardSplitter) ZoneNameASCII() string
ZoneNameASCII gives the ASCII form of the current zone suffix.