Documentation
¶
Index ¶
- func CutWwwPrefix(str string) string
- func DomainToLowerASCII(domainName string) string
- func GetDomainPartFromEmailAddress(s string) string
- func HasHttpPrefix(str string) bool
- func HasHttpsPrefix(str string) bool
- func HasIdnMarker(str string) bool
- func HasWwwPrefix(str string) bool
- func IsIdn(s string) bool
- func IsValidAsciiDomainNameLowerCase(name string) bool
- func IsValidDomainName(name string) bool
- func IsValidEmailAddress(emailAddress string) bool
- func IsValidEmailAddressLowerCase(emailAddress string) bool
- func SafeAsciiDomainName(s string) string
- func SafeToAscii(s string) string
- func SafeToIdn(s string) string
- func ToASCII(s string) (string, error)
- func ToUnicode(s string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CutWwwPrefix ¶
CutWwwPrefix remove a www prefix from string (regardless of the size of the characters - lowercase letters)
func DomainToLowerASCII ¶
DomainToLowerASCII quick conversion of domain names written as ASCII or UTF8 IDN to ASCII and returns the name written in lowercase. REMARK! It won't work for names that consist of several parts - check HasIdnMarker and IsIdn
func HasHttpPrefix ¶
HasHttpPrefix whether the value has a http prefix (regardless of the size of the characters - lowercase letters)
func HasHttpsPrefix ¶
HasHttpsPrefix whether the value has a https prefix (regardless of the size of the characters - lowercase letters)
func HasIdnMarker ¶
HasIdnMarker optimized check if the str has a marker indicating that the domain is of the IDN type (regardless of the size of the characters - lowercase letters) however, this will not work for FQDNs that consist of several hostnames, and only one of them is of the IDN type, so in this situation it is better to use IsIdn
func HasWwwPrefix ¶
HasWwwPrefix whether the value has a www prefix (regardless of the size of the characters - lowercase letters)
func IsIdn ¶
IsIdn checks if the domain has an IDN tag somewhere, because it can be e.g. only a selected FQDN frame: example.xn--p1ai (example.рф) the tag does not have to appear at the beginning of the string, so you cannot use HasIdnMarker
func IsValidDomainName ¶
func IsValidEmailAddress ¶
func SafeAsciiDomainName ¶
func SafeToAscii ¶
Types ¶
This section is empty.