Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidDomain ¶ added in v0.64.3
IsValidDomain checks if a single domain string is valid. Does not convert unicode to punycode - domain must already be ASCII/punycode. Allows wildcard prefix (*.example.com).
func IsValidDomainNoWildcard ¶ added in v0.64.3
IsValidDomainNoWildcard checks if a single domain string is valid without wildcard prefix. Use for zone domains and CNAME targets where wildcards are not allowed.
func ValidateDomainsList ¶
ValidateDomainsList validates domains without punycode conversion. Use this for domains that must already be in ASCII/punycode format (e.g., extra DNS labels). Unlike ValidateDomains, this does not convert unicode to punycode - unicode domains will fail. Allows wildcard prefix (*.example.com). Maximum 32 domains.
Types ¶
type Domain ¶
type Domain string
Domain represents a punycode-encoded domain string. This should only be converted from a string when the string already is in punycode, otherwise use FromString.
func FromString ¶
FromString creates a Domain from a string, converting it to punycode.
func (Domain) PunycodeString ¶
PunycodeString returns the punycode representation of the Domain. This should only be used if a punycode domain is expected but only a string is supported.
func (Domain) SafeString ¶
SafeString converts the Domain to a non-punycode string, falling back to the punycode string if conversion fails.
type List ¶
type List []Domain
List is a slice of punycode-encoded domain strings.
func FromPunycodeList ¶
FromPunycodeList creates a List from a slice of Punycode-encoded domain strings.
func FromStringList ¶
FromStringList creates a DomainList from a slice of string.
func ValidateDomains ¶
ValidateDomains validates domains and converts unicode to punycode. Allows wildcard prefix (*.example.com). Maximum 32 domains.
func (List) PunycodeString ¶
PunycodeString converts the List to a comma-separated string of Punycode-encoded domains.
func (List) SafeString ¶
SafeString converts List to a comma-separated non-punycode string. If a domain cannot be converted, the original string is used.
func (List) ToPunycodeList ¶
ToPunycodeList converts the List to a slice of Punycode-encoded domain strings.
func (List) ToSafeStringList ¶
ToSafeStringList converts the List to a slice of non-punycode strings. If a domain cannot be converted, the original string is used.
func (List) ToStringList ¶
ToStringList converts a List to a slice of string.