utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 14 Imported by: 54

Documentation

Index

Constants

View Source
const (
	CHAR_EMPTY          = ""
	CHAR_WHITESPACE     = " "
	CHAR_FORWARD_SLASH  = "/"
	CHAR_BACKWARD_SLASH = "\\"
	CHAR_HYPHEN         = "-"
	CHAR_COMMA          = ","

	BYTE_HYPHEN = '-'
)

Variables

This section is empty.

Functions

func GenerateChecksumId

func GenerateChecksumId(prefix string, key string) (new_id string)

func GenerateKeyIdFromName

func GenerateKeyIdFromName(name string) string

func GenerateNextKeyId

func GenerateNextKeyId(name string) string

func GenerateUniqueId

func GenerateUniqueId(_prefix string) (prefix string)

func GetMD5Hash

func GetMD5Hash(text string) string

func GetRandomOTP added in v1.0.1

func GetRandomOTP(maxDigits int) string

func IsEmpty added in v1.0.1

func IsEmpty(str string) bool

func IsMemberExist

func IsMemberExist(data Map, member string) (string, error)

func MakeCapitalRandomString

func MakeCapitalRandomString(n int) string

func MakeRandomString

func MakeRandomString(n int) string

func RemoveSpecialChars

func RemoveSpecialChars(str string) string

func RemoveWhiteSpaces

func RemoveWhiteSpaces(str string) string

func ReplaceString

func ReplaceString(str string, old string, new string) string

func SHA

func SHA(text string) string

func ToLower

func ToLower(str string) string

func ToTitle

func ToTitle(str string) string

func ToUppper

func ToUppper(str string) string

func Trim

func Trim(str string) string

func TrimAll

func TrimAll(str string) string

func ValidateDocumentKey

func ValidateDocumentKey(id string) (bool, error)

ValidateDocumentKey -

Types

type AppActions

type AppActions struct {
	ApplicationName string      `json:"app_name"`
	Permission      string      `json:"permission"`
	Modules         []AppModule `json:"modules"`
}

type AppError

type AppError struct {
	ErrorStatus int
	ErrorCode   string /* [A..action/S.. Service/D.. Dao /X.. External API][X AABBCCEE]*/
	ErrorMsg    string
	ErrorDetail string
}

Error -- Application Error Structure

func (*AppError) Error

func (e *AppError) Error() string

type AppFunction

type AppFunction struct {
	FunctionName string `json:"function_name"`
	Permission   string `json:"permission"`
}

AppFunction -- Application Function Structure

type AppModule

type AppModule struct {
	ModuleName string         `json:"module_name"`
	Permission string         `json:"permission"`
	SubModules []AppSubModule `json:"submodules"`
}

type AppSubModule

type AppSubModule struct {
	SubModuleName string        `json:"module_name"`
	Permission    string        `json:"permission"`
	Functions     []AppFunction `json:"functions"`
}

type Map

type Map map[string]interface{}

func CopyMap

func CopyMap(src Map) Map

func MergeMap

func MergeMap(dstMap Map, srcMap Map, createNew bool) Map

Jump to

Keyboard shortcuts

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