Documentation ¶
Index ¶
- func BasenameToNamecoinKey(basename string) (string, error)
- func NamecoinKeyToBasename(key string) (string, error)
- func ParseFuzzyDomainName(name string) (string, error)
- func ParseFuzzyDomainNameNC(name string) (bareName string, namecoinKey string, err error)
- func SplitDomainByFloatingAnchor(qname, anchor string) (subname, basename, rootname string, err error)
- func SplitDomainHead(name string) (head, rest string)
- func SplitDomainTail(name string) (tail, rest string)
- func ValidateDomainLabel(label string) bool
- func ValidateDomainName(name string) bool
- func ValidateEmail(email string) bool
- func ValidateHostLabel(label string) bool
- func ValidateHostName(name string) bool
- func ValidateLabelLength(label string) bool
- func ValidateNameLength(name string) bool
- func ValidateOwnerLabel(label string) bool
- func ValidateOwnerName(name string) bool
- func ValidateRelDomainName(name string) bool
- func ValidateRelHostName(name string) bool
- func ValidateRelOwnerName(name string) bool
- func ValidateServiceName(label string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasenameToNamecoinKey ¶
Convert a domain name basename (e.g. "example") to a Namecoin domain name key name ("d/example").
func NamecoinKeyToBasename ¶
Convert a Namecoin domain name key name (e.g. "d/example") to a domain name basename ("example").
func ParseFuzzyDomainName ¶
Takes a name in the form "d/example" or "example.bit" and converts it to the bareword "example". Returns an error if the input is in neither form.
func ParseFuzzyDomainNameNC ¶
func SplitDomainByFloatingAnchor ¶
func SplitDomainByFloatingAnchor(qname, anchor string) (subname, basename, rootname string, err error)
For domains of the form "Y1.Y2...Yn.ANCHOR.X1.X2...Xn.", returns the following values:
basename is the name appearing directly beneath the anchor (Yn).
subname contains any additional labels appearing beneath the anchor (Y1 through Y(n-1)), separated by dots.
rootname contains ANCHOR through Xn inclusive, separated by dots.
If no label corresponds to ANCHOR, an error is returned. If ANCHOR is the first label, basename is an empty string.
Examples, where anchor="bit":
"a.b.c.d." -> merr.ErrNotInZone "a.b.c.d.bit." -> subname="a.b.c", basename="d", rootname="bit" "d.bit." -> subname="", basename="d", rootname="bit" "bit." -> subname="", basename="", rootname="bit" "bit.x.y.z." -> subname="", basename="", rootname="bit.x.y.z" "d.bit.x.y.z." -> subname="", basename="d", rootname="bit.x.y.z" "c.d.bit.x.y.z." -> subname="c", basename="d", rootname="bit.x.y.z" "a.b.c.d.bit.x.y.z." -> subname="a.b.c", basename="d", rootname="bit.x.y.z"
func SplitDomainHead ¶
Split a domain name a.b.c.d.e into parts e (the head) and a.b.c.d (the rest).
func SplitDomainTail ¶
Split a domain name a.b.c.d.e into parts a (the tail) and b.c.d.e (the rest).
func ValidateDomainLabel ¶
func ValidateDomainName ¶
func ValidateEmail ¶
func ValidateHostLabel ¶
func ValidateHostName ¶
func ValidateLabelLength ¶
func ValidateNameLength ¶
func ValidateOwnerLabel ¶
func ValidateOwnerName ¶
func ValidateRelDomainName ¶
func ValidateRelHostName ¶
func ValidateRelOwnerName ¶
func ValidateServiceName ¶
Types ¶
This section is empty.