util

package
v1.71.4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 24 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToString

func BoolToString(b bool) string

func CamelToSnakeCase

func CamelToSnakeCase(camel string) string

CamelToSnakeCase This function transform camelcase in snakecase LoremIpsum in lorem_ipsum

func EnsureFileFolderExists

func EnsureFileFolderExists(path string)

func FileExist

func FileExist(path string) bool

func FilterQuery

func FilterQuery(urlString string, blackList []string) string

func GenerateClientId

func GenerateClientId() string

func GenerateClientSecret

func GenerateClientSecret() string

func GenerateId

func GenerateId() string

func GenerateSimpleTimeId added in v1.29.0

func GenerateSimpleTimeId() string

func GenerateTimeId added in v1.27.6

func GenerateTimeId() string

func GetCurrentTime

func GetCurrentTime() string

func GetCurrentUnixTime

func GetCurrentUnixTime() string

func GetHmacSha1 added in v1.62.0

func GetHmacSha1(keyStr, value string) string

func GetIPFromRequest

func GetIPFromRequest(req *http.Request) string

func GetIPInfo

func GetIPInfo(clientIP string) string

func GetId

func GetId(name string) string

func GetMaskedEmail added in v1.29.1

func GetMaskedEmail(email string) string

func GetMaskedPhone added in v1.29.1

func GetMaskedPhone(phone string) string

func GetMaxLenStr

func GetMaxLenStr(strs ...string) string

func GetMd5Hash

func GetMd5Hash(text string) string

func GetMinLenStr

func GetMinLenStr(strs ...string) string

func GetOwnerAndNameFromId

func GetOwnerAndNameFromId(id string) (string, string)

func GetOwnerAndNameFromIdNoCheck

func GetOwnerAndNameFromIdNoCheck(id string) (string, string)

func GetPath

func GetPath(path string) string

func GetUploadXlsxPath

func GetUploadXlsxPath(fileId string) string

func GetUrlHost

func GetUrlHost(urlString string) string

func GetUrlPath

func GetUrlPath(urlString string) string

func IsChinese

func IsChinese(str string) bool

func IsEmailValid

func IsEmailValid(email string) bool

func IsPhoneCnValid

func IsPhoneCnValid(phone string) bool

func IsStrsEmpty

func IsStrsEmpty(strs ...string) bool

func IsTokenExpired added in v1.15.0

func IsTokenExpired(createdTime string, expiresIn int) bool

func JsonToStruct

func JsonToStruct(data string, v interface{}) error

func LogInfo

func LogInfo(ctx *context.Context, f string, v ...interface{})

func LogWarning

func LogWarning(ctx *context.Context, f string, v ...interface{})

func ParseBool

func ParseBool(s string) bool

func ParseFloat added in v1.27.6

func ParseFloat(s string) float64

func ParseInt

func ParseInt(s string) int

func ReadStringFromPath

func ReadStringFromPath(path string) string

func RemoveExt

func RemoveExt(filename string) string

func SafeGoroutine added in v1.44.3

func SafeGoroutine(fn func())

func SnakeString

func SnakeString(s string) string

SnakeString transform XxYy to xx_yy

func StructToJson

func StructToJson(v interface{}) string

func StructToJsonFormatted

func StructToJsonFormatted(v interface{}) string

func UrlJoin

func UrlJoin(base string, path string) string

func WriteStringToPath

func WriteStringToPath(s string, path string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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