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 GetOwnerAndNameFromIdWithError(id string) (string, string, error)
- func GetOwnerFromId(id string) string
- func GetPath(path string) string
- func GetRandomName() string
- func GetSessionId(owner, name, application string) string
- func GetSharedOrgFromApp(rawName string) (name string, organization 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 ¶
func CasbinToSlice(casbinRule xormadapter.CasbinRule) []string
func ContainsString ¶
func FilterField ¶
func FilterQuery ¶
func GenerateClientId ¶
func GenerateClientId() string
func GenerateClientSecret ¶
func GenerateClientSecret() string
func GenerateId ¶
func GenerateId() string
func GenerateSimpleTimeId ¶
func GenerateSimpleTimeId() string
func GenerateTimeId ¶
func GenerateTimeId() string
func GetCurrentTime ¶
func GetCurrentTime() string
func GetCurrentTimeEx ¶
func GetCurrentUnixTime ¶
func GetCurrentUnixTime() string
func GetHmacSha1 ¶
func GetHmacSha256 ¶
func GetIPFromRequest ¶
func GetMaskedEmail ¶
func GetMaskedPhone ¶
func GetMd5Hash ¶
func GetOwnerAndNameFromId ¶
func GetOwnerFromId ¶
func GetRandomName ¶
func GetRandomName() string
func GetSessionId ¶
func GetSharedOrgFromApp ¶
func GetUploadXlsxPath ¶
func GetUrlHost ¶
func GetUrlPath ¶
func GetUsernameFromEmail ¶
func HaveIntersection ¶
func IsEmailValid ¶
func IsInvitationCodeMatch ¶
func IsPhoneAllowInRegin ¶
func IsPhoneValid ¶
func IsStringsEmpty ¶
func JsonToStruct ¶
func LogWarning ¶
func MatrixToCasbinRules ¶
func MatrixToCasbinRules(Ptype string, policies [][]string) []*xormadapter.CasbinRule
func ParseFloat ¶
func ParseIdToString ¶
func ParseIntWithError ¶
func ReadStringFromPath ¶
func ReturnAnyNotEmpty ¶
func SafeGoroutine ¶
func SafeGoroutine(fn func())
func SnakeToCamel ¶
func SpaceToCamel ¶
func String2Time ¶
func StringToInterfaceArray ¶
func StringToInterfaceArray(array []string) []interface{}
func StringToInterfaceArray2d ¶
func StringToInterfaceArray2d(arrays [][]string) [][]interface{}
func StructToJson ¶
func StructToJson(v interface{}) string
func StructToJsonFormatted ¶
func StructToJsonFormatted(v interface{}) string
func Time2String ¶
func WriteStringToPath ¶
Types ¶
type SystemInfo ¶
type SystemInfo struct { CpuUsage []float64 `json:"cpuUsage"` MemoryUsed uint64 `json:"memoryUsed"` MemoryTotal uint64 `json:"memoryTotal"` }
func GetSystemInfo ¶
func GetSystemInfo() (*SystemInfo, error)
type VersionInfo ¶
type VersionInfo struct { Version string `json:"version"` CommitId string `json:"commitId"` CommitOffset int `json:"commitOffset"` }
func GetVersionInfo ¶
func GetVersionInfo() (*VersionInfo, error)
GetVersionInfo get git current commit and repo release version
Click to show internal directories.
Click to hide internal directories.