Documentation ¶
Index ¶
- Variables
- func ConvTimeFmt(timeStr, inFmt, outFmt string) (string, error)
- func ConvTimeFmtInLocation(timeStr, inFmt, outFmt string, loc *time.Location) (string, error)
- func ForceQueryPSPlusOne(ps string) bool
- func GetDescentLevel(ps string) string
- func GetGlobalLoc() (*time.Location, error)
- func GetHost(domain string) (string, error)
- func GetPublicSuffixs(domain string) ([]string, error)
- func GetTLD(ps string) string
- func GuessTimeFmt(timeStr string, loc *time.Location) (time.Time, error)
- func GuessTimeFmtAndConvert(timeStr, outFmt string) (string, error)
- func IsIP(host string) bool
- func IsTimeout(err error) bool
- func SetGlobalLoc() (err error)
- func StrInArray(val string, arr []string) bool
- func UTCNow() time.Time
Constants ¶
This section is empty.
Variables ¶
var GlobalLoc *time.Location
GlobalLoc is global timezone for converting time format
Functions ¶
func ConvTimeFmt ¶
ConvTimeFmt converts time from input format to ouput format
func ConvTimeFmtInLocation ¶
ConvTimeFmtInLocation converts time from input format with timezone to ouput format in UTC
func ForceQueryPSPlusOne ¶
If length of all the items in public suffix less than 3, force query publicsuffix + 1 first no matter it's ICANN-managed domain or not E.g. "co.uk", "jpn.com", "net.ua" -> true E.g. "github.io", "zhitomir.ua" -> false
func GetDescentLevel ¶
GetDescentLevel get n-1 level of ps E.g., "abc.co.com" -> "co.com"
func GetGlobalLoc ¶
GetGlobalLoc get global timezone if set, else load again
func GetHost ¶
GetHost fetch host from "<host>:<port>" string, and return input string if it does not contain port
func GetPublicSuffixs ¶
GetPublicSuffixs returns public suffixs of input domain
func GetTLD ¶
return string after first ".", and return input string if it does not contains "." E.g,
GetTLD("aaa.aaa") = "aaa" GetTLD("pooch.co.uk") = "co.uk" GetTLD("com") = "com"
func GuessTimeFmt ¶
GuessTimeFmt guesses input time string and converts to time object
func GuessTimeFmtAndConvert ¶
GuessTimeFmtAndConvert guesses input time string and converts to output format string
func StrInArray ¶
StrInArray returns whether item is in array
Types ¶
This section is empty.