domaintools

package module
v0.0.0-...-f10363f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutWwwPrefix

func CutWwwPrefix(str string) string

CutWwwPrefix remove a www prefix from string (regardless of the size of the characters - lowercase letters)

func DomainToLowerASCII

func DomainToLowerASCII(domainName string) string

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 GetDomainPartFromEmailAddress

func GetDomainPartFromEmailAddress(s string) string

func HasHttpPrefix

func HasHttpPrefix(str string) bool

HasHttpPrefix whether the value has a http prefix (regardless of the size of the characters - lowercase letters)

func HasHttpsPrefix

func HasHttpsPrefix(str string) bool

HasHttpsPrefix whether the value has a https prefix (regardless of the size of the characters - lowercase letters)

func HasIdnMarker

func HasIdnMarker(str string) bool

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

func HasWwwPrefix(str string) bool

HasWwwPrefix whether the value has a www prefix (regardless of the size of the characters - lowercase letters)

func IsIdn

func IsIdn(s string) bool

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 IsValidAsciiDomainNameLowerCase

func IsValidAsciiDomainNameLowerCase(name string) bool

func IsValidDomainName

func IsValidDomainName(name string) bool

func IsValidEmailAddress

func IsValidEmailAddress(emailAddress string) bool

func IsValidEmailAddressLowerCase

func IsValidEmailAddressLowerCase(emailAddress string) bool

func SafeAsciiDomainName

func SafeAsciiDomainName(s string) string

func SafeToAscii

func SafeToAscii(s string) string

func SafeToIdn

func SafeToIdn(s string) string

func ToASCII

func ToASCII(s string) (string, error)

func ToUnicode

func ToUnicode(s string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL