Documentation ¶
Index ¶
- Variables
- func BoolToString(b bool) string
- func CamelToSnakeCase(camel string) string
- func CasbinToSlice(casbinRule xormadapter.CasbinRule) []string
- func ContainsString(values []string, val string) bool
- func DeleteVal(values []string, val string) []string
- func EnsureFileFolderExists(path string)
- func FileExist(path string) bool
- func FilterField(field string) bool
- func FilterQuery(urlString string, blackList []string) string
- func GenerateClientId() string
- func GenerateClientSecret() string
- func GenerateId() string
- func GenerateSimpleTimeId() string
- func GenerateTimeId() string
- func GetCountryCode(prefix string, phone string) (string, error)
- func GetCurrentTime() string
- func GetCurrentTimeEx(timestamp string) string
- func GetCurrentUnixTime() string
- func GetE164Number(phone string, countryCode string) (string, bool)
- func GetEndPoint(endpoint string) string
- func GetHmacSha1(keyStr, value string) string
- func GetHmacSha256(key string, data string) string
- func GetIPFromRequest(req *http.Request) string
- func GetIPInfo(clientIP string) string
- func GetId(owner, name string) string
- func GetMaskedEmail(email string) string
- func GetMaskedPhone(phone string) string
- func GetMaxLenStr(strs ...string) string
- func GetMd5Hash(text string) string
- func GetMinLenStr(strs ...string) string
- func GetOwnerAndNameAndOtherFromId(id string) (string, string, string)
- func GetOwnerAndNameFromId(id string) (string, string)
- func GetOwnerAndNameFromIdNoCheck(id string) (string, string)
- func GetOwnerFromId(id string) string
- func GetPath(path string) string
- func GetRandomName() string
- func GetSessionId(owner, name, application string) string
- func GetUploadXlsxPath(fileId string) string
- func GetUrlHost(urlString string) string
- func GetUrlPath(urlString string) string
- func HasString(strs []string, str string) bool
- func InSlice(slice []string, elem string) bool
- func IsChinese(str string) bool
- func IsEmailValid(email string) bool
- func IsPhoneAllowInRegin(countryCode string, allowRegions []string) bool
- func IsPhoneValid(phone string, countryCode string) bool
- func IsStringsEmpty(strs ...string) bool
- func IsTokenExpired(createdTime string, expiresIn int) bool
- func JsonToStruct(data string, v interface{}) error
- func ListFiles(path string) []string
- func LogInfo(ctx *context.Context, f string, v ...interface{})
- func LogWarning(ctx *context.Context, f string, v ...interface{})
- func ParseBool(s string) bool
- func ParseFloat(s string) float64
- func ParseIdToString(input interface{}) (string, error)
- func ParseInt(s string) int
- func ReadStringFromPath(path string) string
- func RemoveExt(filename string) string
- func ReplaceVal(values []string, oldVal string, newVal string) []string
- func ReturnAnyNotEmpty(strs ...string) string
- func SafeGoroutine(fn func())
- func SnakeString(s string) string
- func StructToJson(v interface{}) string
- func StructToJsonFormatted(v interface{}) string
- func UrlJoin(base string, path string) string
- func WriteStringToPath(s string, path string)
- type SystemInfo
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BoolToString ¶
func CamelToSnakeCase ¶
CamelToSnakeCase This function transform camelcase in snakecase LoremIpsum in lorem_ipsum
func CasbinToSlice ¶ added in v1.166.0
func CasbinToSlice(casbinRule xormadapter.CasbinRule) []string
func ContainsString ¶ added in v1.245.0
func EnsureFileFolderExists ¶
func EnsureFileFolderExists(path string)
func FilterField ¶ added in v1.351.2
func FilterQuery ¶
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 GetCountryCode ¶ added in v1.309.0
func GetCurrentTime ¶
func GetCurrentTime() string
func GetCurrentTimeEx ¶ added in v1.309.0
func GetCurrentUnixTime ¶
func GetCurrentUnixTime() string
func GetE164Number ¶ added in v1.245.0
func GetEndPoint ¶ added in v1.298.0
GetEndPoint remove scheme from url
func GetHmacSha1 ¶ added in v1.62.0
func GetHmacSha256 ¶ added in v1.81.0
func GetIPFromRequest ¶
func GetMaskedEmail ¶ added in v1.29.1
func GetMaskedPhone ¶ added in v1.29.1
func GetMaxLenStr ¶
func GetMd5Hash ¶
func GetMinLenStr ¶
func GetOwnerAndNameAndOtherFromId ¶ added in v1.239.0
func GetOwnerAndNameFromId ¶
func GetOwnerFromId ¶ added in v1.288.0
func GetRandomName ¶ added in v1.309.0
func GetRandomName() string
func GetSessionId ¶ added in v1.239.0
func GetUploadXlsxPath ¶
func GetUrlHost ¶
func GetUrlPath ¶
func IsEmailValid ¶
func IsPhoneAllowInRegin ¶ added in v1.245.0
func IsPhoneValid ¶ added in v1.245.0
func IsStringsEmpty ¶ added in v1.245.1
func IsTokenExpired ¶ added in v1.15.0
func JsonToStruct ¶
func LogWarning ¶
func ParseFloat ¶ added in v1.27.6
func ParseIdToString ¶ added in v1.358.0
func ReadStringFromPath ¶
func ReplaceVal ¶ added in v1.343.0
func ReturnAnyNotEmpty ¶ added in v1.293.0
func SafeGoroutine ¶ added in v1.44.3
func SafeGoroutine(fn func())
func StructToJson ¶
func StructToJson(v interface{}) string
func StructToJsonFormatted ¶
func StructToJsonFormatted(v interface{}) string
func WriteStringToPath ¶
Types ¶
type SystemInfo ¶ added in v1.265.0
type SystemInfo struct { CpuUsage []float64 `json:"cpuUsage"` MemoryUsed uint64 `json:"memoryUsed"` MemoryTotal uint64 `json:"memoryTotal"` }
func GetSystemInfo ¶ added in v1.265.0
func GetSystemInfo() (*SystemInfo, error)
type VersionInfo ¶ added in v1.265.0
type VersionInfo struct { Version string `json:"version"` CommitId string `json:"commitId"` CommitOffset int `json:"commitOffset"` }
func GetVersionInfo ¶ added in v1.265.0
func GetVersionInfo() (*VersionInfo, error)
GetVersionInfo get git current commit and repo release version
func GetVersionInfoFromFile ¶ added in v1.268.0
func GetVersionInfoFromFile() (*VersionInfo, error)
Click to show internal directories.
Click to hide internal directories.