std

package
v0.0.0-...-ac9cef7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcEveryPageNumber

func CalcEveryPageNumber(count, size, index int) (start, end int)

CalcEveryPageNumber returns a page start, end numbers by count, size, index.

func ConvertBasicType

func ConvertBasicType(value string, objType reflect.Type, objValue reflect.Value) error

ConvertBasicType 根据obj的反射类型、值,将value设置给obj。

func CurrentFuncName

func CurrentFuncName() string

func FindStrInSlice

func FindStrInSlice(list []string, str string) int

func GetFuncName

func GetFuncName(fn interface{}) string

func GetLocalHostIP

func GetLocalHostIP() string

GetLocalHostIP returns local IP addr.

func GetMD5

func GetMD5(data string) string

func GetRootDomainName

func GetRootDomainName(domainName string) string

GetRootDomainName 获取域名的根域名,如果pulicsuffix获取没有出错,返回eTLD,否则使用正则获取

func GetRootDomainNameByRegexp

func GetRootDomainNameByRegexp(domainName string) string

GetRootDomainNameByRegexp 使用正则获取域名的要域名

func GetWildcardDomain

func GetWildcardDomain(domainName string) string

func IsLetterOrNumber

func IsLetterOrNumber(str string) bool

func IsValidDomainName

func IsValidDomainName(domainName string) bool

func IsWildcardDomain

func IsWildcardDomain(domainName string) bool

func JSONConvert

func JSONConvert(from any, to any) error

JSONConvert uses json Marshal, Unmarshal to copy.

func JSONDump

func JSONDump(val any) string

JSONDump returns json Marshal string of val.

func LowerFirstChar

func LowerFirstChar(letter string) string

func ParentFuncName

func ParentFuncName() string

func ParentFuncShortName

func ParentFuncShortName() string

func ParsePages

func ParsePages(pageSize, pageIndex int) (int, int)

ParsePages returns page size [1,500] and index [1,]

func ParsePagesFroLarge

func ParsePagesFroLarge(pageSize, pageIndex int) (int, int)

ParsePagesFroLarge returns page size [1,5000] and index [1,]

func ParsePagesWithLimit

func ParsePagesWithLimit(pageSize, pageIndex, pageSizeLimit int) (int, int)

ParsePagesWithLimit returns page size [1,pageSizeLimit] and index [1,]

func ParseRange

func ParseRange(count, pageSize, pageIndex int) (int, int)

ParseRange returns a page start, end numbers by count, size, index.

func ParseRangeForLarge

func ParseRangeForLarge(count, pageSize, pageIndex int) (int, int)

ParseRangeForLarge returns a page start, end numbers by count, size, index.

func ParseRangeWithLimit

func ParseRangeWithLimit(count, pageSize, pageIndex, pageSizeLimit int) (int, int)

ParseRangeWithLimit returns a page start, end numbers by count, size, index.

func RemoveDuplicateStringSlice

func RemoveDuplicateStringSlice(tmp []string) []string

func RemoveStringSlice

func RemoveStringSlice(s []string, removed []string) []string

func ReverseStr

func ReverseStr(str string) string

func SafeGo

func SafeGo(run func())

func SplitDomainBySpecifyLevel

func SplitDomainBySpecifyLevel(domainName string, level int) ([]string, error)

SplitDomainBySpecifyLevel 将域名按指定层级拆分,形成泛域名+域名集合

func SplitFuncName

func SplitFuncName(fn string, separator ...rune) string

func Stringify

func Stringify(v ...any) string

func UnionStringSlice

func UnionStringSlice(s1, s2 []string) []string

func UpperFirstChar

func UpperFirstChar(letter string) string

func ValidIPAddr

func ValidIPAddr(ip string) bool

ValidIPAddr reports whether a valid ip addr.

func ValidJSON

func ValidJSON(str string) bool

ValidJSON checks whether a str is JSON object, {} or [].

Types

This section is empty.

Jump to

Keyboard shortcuts

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