Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayToString(array []interface{}) string
- func AutoInjectionCode(filepath string, funcName string, codeData string) error
- func BreakPointContinue(content []byte, fileName string, contentNumber int, contentTotal int, ...) (error, string)
- func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool)
- func ClearTable(db *gorm.DB, tableName string, compareField string, interval string) error
- func CreateDir(dirs ...string) (err error)
- func Email(subject string, body string) error
- func EmailTest(subject string, body string) error
- func Eq(mark string) string
- func ErrorToEmail(subject string, body string) error
- func FileMove(src string, dst string) (err error)
- func Ge(mark string) string
- func GetWriteSyncer() (zapcore.WriteSyncer, error)
- func Gt(mark string) string
- func Le(mark string) string
- func Lt(mark string) string
- func MD5V(str []byte) string
- func MakeFile(fileName string, FileMd5 string) (error, string)
- func Ne(mark string) string
- func NotEmpty() string
- func PathExists(path string) (bool, error)
- func RegisterRule(key string, rule Rules) (err error)
- func RemoveChunk(FileMd5 string) error
- func StructToMap(obj interface{}) map[string]interface{}
- func TrimSpace(target interface{})
- func Verify(st interface{}, roleMap Rules) (err error)
- func ZipFiles(filename string, files []string, oldForm, newForm string) error
- type Cpu
- type Disk
- type Os
- type Rrm
- type Rules
- type RulesMap
- type Server
Constants ¶
View Source
const ( ConfigEnv = "GVA_CONFIG" ConfigFile = "config.yaml" )
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
View Source
var ( IdVerify = Rules{"ID": {NotEmpty()}} ApiVerify = Rules{"Path": {NotEmpty()}, "Description": {NotEmpty()}, "ApiGroup": {NotEmpty()}, "Method": {NotEmpty()}} MenuVerify = Rules{"Path": {NotEmpty()}, "ParentId": {NotEmpty()}, "Name": {NotEmpty()}, "Component": {NotEmpty()}, "Sort": {Ge("0")}} MenuMetaVerify = Rules{"Title": {NotEmpty()}} LoginVerify = Rules{"CaptchaId": {NotEmpty()}, "Captcha": {NotEmpty()}, "Username": {NotEmpty()}, "Password": {NotEmpty()}} RegisterVerify = Rules{"Username": {NotEmpty()}, "NickName": {NotEmpty()}, "Password": {NotEmpty()}, "AuthorityId": {NotEmpty()}} PageInfoVerify = Rules{"Page": {NotEmpty()}, "PageSize": {NotEmpty()}} CustomerVerify = Rules{"CustomerName": {NotEmpty()}, "CustomerPhoneData": {NotEmpty()}} AutoCodeVerify = Rules{"Abbreviation": {NotEmpty()}, "StructName": {NotEmpty()}, "PackageName": {NotEmpty()}, "Fields": {NotEmpty()}} AuthorityVerify = Rules{"AuthorityId": {NotEmpty()}, "AuthorityName": {NotEmpty()}, "ParentId": {NotEmpty()}} AuthorityIdVerify = Rules{"AuthorityId": {NotEmpty()}} OldAuthorityVerify = Rules{"OldAuthorityId": {NotEmpty()}} ChangePasswordVerify = Rules{"Username": {NotEmpty()}, "Password": {NotEmpty()}, "NewPassword": {NotEmpty()}} SetUserAuthorityVerify = Rules{"UUID": {NotEmpty()}, "AuthorityId": {NotEmpty()}} )
View Source
var CustomizeMap = make(map[string]Rules)
Functions ¶
func ArrayToString ¶
func ArrayToString(array []interface{}) string
func AutoInjectionCode ¶
func BreakPointContinue ¶
func ClearTable ¶
func ErrorToEmail ¶
func GetWriteSyncer ¶
func GetWriteSyncer() (zapcore.WriteSyncer, error)
func PathExists ¶
func RegisterRule ¶
func RemoveChunk ¶
func StructToMap ¶
func StructToMap(obj interface{}) map[string]interface{}
Types ¶
type Disk ¶
type Os ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.