Documentation
¶
Index ¶
- func CalcEveryPageNumber(count, size, index int) (start, end int)
- func ConvertBasicType(value string, objType reflect.Type, objValue reflect.Value) error
- func CurrentFuncName() string
- func FilterExistingIPsInSubnets(ipSources, ipSubnets []string) (result []string, err error)
- func FilterPrivateIPs(ips []string) []net.IP
- func FindStrInSlice(list []string, str string) int
- func GetFuncName(fn interface{}) string
- func GetLocalHostIP() string
- func GetMD5(data string) string
- func GetRootDomainName(domainName string) string
- func GetRootDomainNameByRegexp(domainName string) string
- func GetWildcardDomain(domainName string) string
- func GetWorkDir() string
- func IPInSubnet(ip net.IP, subnet *net.IPNet) bool
- func IPsInSubnets(ips []string, subnets []string) (map[string][]bool, error)
- func InterStringSlice(s1 []string, s2 []string) []string
- func IsLetterOrNumber(str string) bool
- func IsValidDomainName(domainName string) bool
- func IsWildcardDomain(domainName string) bool
- func JSONConvert(from any, to any) error
- func JSONDump(val any) string
- func LowerFirstChar(letter string) string
- func MakeNotExists(dir string)
- func ParentFuncName() string
- func ParentFuncNameAndFileLine() string
- func ParentFuncShortName() string
- func ParseLocalDate(dateStr string) (t time.Time, err error)
- func ParseLocalTime(timeStr string) (t time.Time, err error)
- func ParsePages(pageSize, pageIndex int) (int, int)
- func ParsePagesFroLarge(pageSize, pageIndex int) (int, int)
- func ParsePagesWithLimit(pageSize, pageIndex, pageSizeLimit int) (int, int)
- func ParseRange(count, pageSize, pageIndex int) (int, int)
- func ParseRangeForLarge(count, pageSize, pageIndex int) (int, int)
- func ParseRangeWithLimit(count, pageSize, pageIndex, pageSizeLimit int) (int, int)
- func RandStr(n int) string
- func RemoveDuplicateStringList(tem []string) []string
- func RemoveDuplicateStringSlice(tmp []string) []string
- func RemoveStringSlice(s []string, removed []string) []string
- func ReverseStr(str string) string
- func SafeGo(run func())
- func SecureRandomInt(min, max int) int
- func SplitDomainBySpecifyLevel(domainName string, level int) ([]string, error)
- func SplitFuncName(fn string, separator ...rune) string
- func Stringify(v ...any) string
- func TimeFormat(t time.Time) string
- func UnionStringSlice(s1, s2 []string) []string
- func UpperFirstChar(letter string) string
- func ValidIPAddr(ip string) bool
- func ValidJSON(str string) bool
- func ValidURLHostIpAddr(urlStr string, ipAddrList ...string) string
- func WritePidToFile(pidFile string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcEveryPageNumber ¶
CalcEveryPageNumber returns a page start, end numbers by count, size, index.
func ConvertBasicType ¶
ConvertBasicType 根据obj的反射类型、值,将value设置给obj。
func CurrentFuncName ¶
func CurrentFuncName() string
func FilterExistingIPsInSubnets ¶
FilterExistingIPsInSubnets 过滤存在IP网段中的ip
func FindStrInSlice ¶
func GetFuncName ¶
func GetFuncName(fn interface{}) string
func GetRootDomainName ¶
GetRootDomainName 获取域名的根域名,如果pulicsuffix获取没有出错,返回eTLD,否则使用正则获取
func GetRootDomainNameByRegexp ¶
GetRootDomainNameByRegexp 使用正则获取域名的要域名
func GetWildcardDomain ¶
func GetWorkDir ¶
func GetWorkDir() string
func IPsInSubnets ¶
IPsInSubnets 检查多个IP地址段包含多个IP地址
func InterStringSlice ¶
func IsLetterOrNumber ¶
func IsValidDomainName ¶
func IsWildcardDomain ¶
func JSONConvert ¶
JSONConvert uses json Marshal, Unmarshal to copy.
func LowerFirstChar ¶
func ParentFuncName ¶
func ParentFuncName() string
func ParentFuncNameAndFileLine ¶
func ParentFuncNameAndFileLine() string
ParentFuncNameAndFileLine 获取调用者的详细信息,包括函数名、文件名及行数
func ParentFuncShortName ¶
func ParentFuncShortName() string
func ParsePages ¶
ParsePages returns page size [1,500] and index [1,]
func ParsePagesFroLarge ¶
ParsePagesFroLarge returns page size [1,5000] and index [1,]
func ParsePagesWithLimit ¶
ParsePagesWithLimit returns page size [1,pageSizeLimit] and index [1,]
func ParseRange ¶
ParseRange returns a page start, end numbers by count, size, index.
func ParseRangeForLarge ¶
ParseRangeForLarge returns a page start, end numbers by count, size, index.
func ParseRangeWithLimit ¶
ParseRangeWithLimit returns a page start, end numbers by count, size, index.
func RemoveStringSlice ¶
func ReverseStr ¶
func SecureRandomInt ¶
SecureRandomInt 使用crypto/rand生成安全的随机数 crypto/rand生成的随机数不容易被预测, 但相比math/rand,可能在性能上稍微慢一些,因为使用了操作系统的随机数生成器。
func SplitDomainBySpecifyLevel ¶
SplitDomainBySpecifyLevel 将域名按指定层级拆分,形成泛域名+域名集合
func SplitFuncName ¶
func TimeFormat ¶
func UnionStringSlice ¶
func UpperFirstChar ¶
func ValidURLHostIpAddr ¶
ValidURLHostIpAddr 读取URL中的Host IP地址的有效信息 如果无效信息或解析错误(url.Parse错误、不是ipv4、不是ipv6、不是有效的域名),则返回空字符串
func WritePidToFile ¶
func WritePidToFile(pidFile string)
Types ¶
This section is empty.