Documentation ¶
Index ¶
- Constants
- Variables
- func IsTLD(domain string) bool
- func IsZone(domain string) bool
- type Tags
- type Zone
- func (z *Zone) AllowsIDN() bool
- func (z *Zone) AllowsRegistration() bool
- func (z *Zone) IsDelegated() bool
- func (z *Zone) IsInRootZone() bool
- func (z *Zone) IsTLD() bool
- func (z *Zone) Languages() []string
- func (z *Zone) RDAPURLs() []string
- func (z *Zone) WhoisServer() string
- func (z *Zone) WhoisURL() string
Examples ¶
Constants ¶
const ( TagAdult = 1 TagBrand = 2 TagCity = 4 TagClosed = 8 TagCommunity = 16 TagCountry = 32 TagGeneric = 64 TagGeo = 128 TagInfrastructure = 256 TagPrivate = 512 TagRegion = 1024 TagReserved = 2048 TagRetired = 4096 TagSpecial = 8192 TagSponsored = 16384 TagTest = 32768 TagWithdrawn = 65536 )
Tag values corresponding to bit shifts (1 << iota)
Variables ¶
var List list
List implements the cookiejar.PublicSuffixList interface.
var TLDs = z[:1757]
TLDs is a slice of all top-level domain Zones.
var TagStrings = map[Tags]string{ TagAdult: "adult", TagBrand: "brand", TagCity: "city", TagClosed: "closed", TagCommunity: "community", TagCountry: "country", TagGeneric: "generic", TagGeo: "geo", TagInfrastructure: "infrastructure", TagPrivate: "private", TagRegion: "region", TagReserved: "reserved", TagRetired: "retired", TagSpecial: "special", TagSponsored: "sponsored", TagTest: "test", TagWithdrawn: "withdrawn", }
TagStrings maps integer tag values to strings.
var TagValues = map[string]Tags{ "adult": TagAdult, "brand": TagBrand, "city": TagCity, "closed": TagClosed, "community": TagCommunity, "country": TagCountry, "generic": TagGeneric, "geo": TagGeo, "infrastructure": TagInfrastructure, "private": TagPrivate, "region": TagRegion, "reserved": TagReserved, "retired": TagRetired, "special": TagSpecial, "sponsored": TagSponsored, "test": TagTest, "withdrawn": TagWithdrawn, }
TagValues maps tag names to integer values.
var ZoneMap map[string]*Zone
ZoneMap maps domain names to Zones.
var Zones = z[:]
Zones is a slice of all Zones in the database.
Functions ¶
Types ¶
type Tags ¶
type Tags uint32
Tags are stored in a single integer as a bit field.
type Zone ¶
type Zone struct { // Normalized (ASCII, punycode) fully-qualified domain name Domain string // Parent Zone (nil if Zone is a TLD) Parent *Zone // Slice of subdomain (child) Zones (nil if empty) Subdomains []Zone // Tags stored as an integer bit field Tags Tags // Registry operator for this Zone RegistryOperator string // Informational URL for this Zone InfoURL string // DNS name servers for this Zone NameServers []string // Wildcard addresses for unregistered subdomains Wildcards []string // Locations associated with this Zone Locations []string // contains filtered or unexported fields }
Zone represents a single DNS zone (a public suffix), where subdomains may be registered or created.
func PublicZone ¶
PublicZone returns the public zone for a given domain name or nil if none found. Input must be normalized by the client (lowercase, ASCII-encoded).
func (*Zone) AllowsIDN ¶
AllowsIDN returns true if the zone operator (registry) permits registration of non-ASCII labels under this Zone.
func (*Zone) AllowsRegistration ¶
AllowsRegistration returns true if the Zone’s authority (registry) permits registration of subdomains of this Zone. Examples include zones that are closed, withdrawn, or retired zones. A closed zone is where the registry operator does not permit registration, typically at the second level, like .ck. A withdrawn zone is a gTLD that was withdrawn and removed from the root zone file by the RO. A retired zone was active, but has since been undelegated.
func (*Zone) IsDelegated ¶
IsDelegated returns true if the Zone has name servers.
func (*Zone) IsInRootZone ¶
IsInRootZone returns true if the Zone is a top-level domain. present in the root DNS zone.
func (*Zone) WhoisServer ¶
WhoisServer returns the whois server that responds on port 43 for the zone. It first searches the specific zone, then the parent, returning an empty string if none found.