Documentation ¶
Index ¶
- Variables
- func BcryptCheck(password, hash string) bool
- func BcryptHash(password string) string
- func BreakPointContinue(content []byte, fileName string, contentNumber int, contentTotal int, ...) (string, error)
- func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool)
- func Eq(mark string) string
- func Ge(mark string) string
- func Gt(mark string) string
- func Le(mark string) string
- func Lt(mark string) string
- func MD5V(str []byte, b ...byte) string
- func MakeFile(fileName string, FileMd5 string) (string, error)
- func Ne(mark string) string
- func NotEmpty() string
- func ParseDuration(d string) (time.Duration, error)
- func RegexpMatch(rule string) string
- func RegisterRule(key string, rule Rules) (err error)
- func RemoveChunk(FileMd5 string) error
- func Verify(st interface{}, roleMap Rules) (err error)
- type Rules
- type RulesMap
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IdVerify = Rules{"Ids": []string{NotEmpty()}} ApiVerify = Rules{"Path": {NotEmpty()}, "Description": {NotEmpty()}, "ApiGroup": {NotEmpty()}, "Method": {NotEmpty()}} MenuVerify = Rules{"Path": {NotEmpty()}, "Name": {NotEmpty()}, "Component": {NotEmpty()}, "Sort": {Ge("0")}} MenuMetaVerify = Rules{"Title": {NotEmpty()}} LoginVerify = Rules{"CaptchaId": {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()}} AutoPackageVerify = Rules{"PackageName": {NotEmpty()}} AuthorityVerify = Rules{"AuthorityId": {NotEmpty()}, "AuthorityName": {NotEmpty()}} AuthorityIdVerify = Rules{"AuthorityId": {NotEmpty()}} OldAuthorityVerify = Rules{"OldAuthorityId": {NotEmpty()}} ChangePasswordVerify = Rules{"Password": {NotEmpty()}, "NewPassword": {NotEmpty()}} SetUserAuthorityVerify = Rules{"AuthorityId": {NotEmpty()}} )
View Source
var CustomizeMap = make(map[string]Rules)
Functions ¶
func BreakPointContinue ¶
func RegexpMatch ¶
func RegisterRule ¶
func RemoveChunk ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.