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 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 GetMd5Hash(text 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 GetUsernameFromEmail(email string) string
- func GetValueFromDataSourceName(key string, dataSourceName string) string
- func HasString(strs []string, str string) bool
- func HaveIntersection(arr1 []string, arr2 []string) bool
- func InSlice(slice []string, elem string) bool
- func IsChinese(str string) bool
- func IsEmailValid(email string) bool
- func IsInvitationCodeMatch(pattern string, invitationCode string) (bool, error)
- func IsPhoneAllowInRegin(countryCode string, allowRegions []string) bool
- func IsPhoneValid(phone string, countryCode string) bool
- func IsRegexp(s string) (bool, error)
- func IsStringsEmpty(strs ...string) bool
- func IsTokenExpired(createdTime string, expiresIn int) (bool, string)
- 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 MatrixToCasbinRules(Ptype string, policies [][]string) []*xormadapter.CasbinRule
- func ParseBool(s string) bool
- func ParseFloat(s string) float64
- func ParseIdToString(input interface{}) (string, error)
- func ParseInt(s string) int
- func ParseIntWithError(s string) (int, error)
- 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 SnakeToCamel(snake string) string
- func SpaceToCamel(name string) string
- func String2Time(timestamp string) time.Time
- func StringToInterfaceArray(array []string) []interface{}
- func StringToInterfaceArray2d(arrays [][]string) [][]interface{}
- func StructToJson(v interface{}) string
- func StructToJsonFormatted(v interface{}) string
- func Time2String(timestamp time.Time) string
- func TryJsonToAnonymousStruct(j string) (interface{}, error)
- 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 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 GetMd5Hash ¶
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 GetUsernameFromEmail ¶ added in v1.419.0
func GetValueFromDataSourceName ¶ added in v1.406.0
func HaveIntersection ¶ added in v1.439.0
func IsEmailValid ¶
func IsInvitationCodeMatch ¶ added in v1.510.0
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 MatrixToCasbinRules ¶ added in v1.393.0
func MatrixToCasbinRules(Ptype string, policies [][]string) []*xormadapter.CasbinRule
func ParseFloat ¶ added in v1.27.6
func ParseIdToString ¶ added in v1.358.0
func ParseIntWithError ¶ added in v1.474.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 SnakeToCamel ¶ added in v1.387.1
func SpaceToCamel ¶ added in v1.538.0
func String2Time ¶ added in v1.430.0
func StringToInterfaceArray ¶ added in v1.483.0
func StringToInterfaceArray(array []string) []interface{}
func StringToInterfaceArray2d ¶ added in v1.483.0
func StringToInterfaceArray2d(arrays [][]string) [][]interface{}
func StructToJson ¶
func StructToJson(v interface{}) string
func StructToJsonFormatted ¶
func StructToJsonFormatted(v interface{}) string
func Time2String ¶ added in v1.434.1
func TryJsonToAnonymousStruct ¶ added in v1.519.0
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.