Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayToString(array []interface{}) string
- func BreakPointContinue(content []byte, fileName string, contentNumber int, contentTotal int, ...) (error, string)
- func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool)
- func CreateDir(dirs ...string) (err error)
- func DeleteFile(key string) 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 UploadFileLocal(file *multipart.FileHeader) (err error, localPath string, key string)
- func UploadRemote(file *multipart.FileHeader) (err error, path string, key string)
- 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()}} SetUserVerify = Rules{"ID": {NotEmpty()}, "Username": {NotEmpty()}, "NickName": {NotEmpty()}, "HeaderImg": {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()}} WorkFlowVerify = Rules{"WorkflowNickName": {NotEmpty()}, "WorkflowName": {NotEmpty()}, "WorkflowDescription": {NotEmpty()}, "WorkflowStepInfo": {NotEmpty()}} AuthorityVerify = Rules{"AuthorityId": {NotEmpty()}, "AuthorityName": {NotEmpty()}, "ParentId": {NotEmpty()}} DictionaryVerify = Rules{"Type": {NotEmpty()}, "ID": {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 BreakPointContinue ¶
func DeleteFile ¶
func GetWriteSyncer ¶
func GetWriteSyncer() (zapcore.WriteSyncer, error)
GetWriteSyncer zap logger中加入file-rotatelogs
func PathExists ¶
func RemoveChunk ¶
func UploadFileLocal ¶
func UploadFileLocal(file *multipart.FileHeader) (err error, localPath string, key string)
func UploadRemote ¶
func UploadRemote(file *multipart.FileHeader) (err error, path string, key string)
接收两个参数 一个文件流 一个 bucket 你的七牛云标准空间的名字
Types ¶
type Disk ¶
type Os ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.