Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Build BuildFunc // code 4xx ErrNotRESTfulRequest = errors.New("method not in POST/DELETE/GET/PUT") // code 5xx ErrBuildConfig = errors.New("config for BuildFunc is error") ErrRuleWrong = errors.New("param check rule wrong") ErrAuthLoadCrash = errors.New("auto load crash") )
for init
View Source
var ( PccEmptyStr = &PCC{DefaultV: []string{""}} PccMust = &PCC{Must: true} )
PCC in common use
View Source
var NoMust = new(Must)
NoMust Check
View Source
var ( PmInt = func(ps []string) (interface{}, error) { return strconv.Atoi(ps[0]) } )
ParamModify in common use
Functions ¶
This section is empty.
Types ¶
type BaseLoader ¶
type BaseLoader struct {
Err error
// contains filtered or unexported fields
}
BaseLoader for entity
type BaseRuleBuilder ¶
type BaseRuleBuilder struct {
// Request
Params url.Values // 参数值可以重名,但是大部分时候默认只看第一个
// Result
Err error
}
BaseRuleBuilder for check preparation
type ErrParamWrong ¶
type ErrParamWrong struct {
// contains filtered or unexported fields
}
ErrParamWrong in check
code 4xx
func NewErrParamWrong ¶
func NewErrParamWrong(name, msg string) ErrParamWrong
NewErrParamWrong Builder
func (ErrParamWrong) Error ¶
func (e ErrParamWrong) Error() string
type Middleware ¶
func ParamAutoLoad ¶
func ParamAutoLoad(modify ParamModifyList, entity interface{}) Middleware
ParamAutoLoad Wrapper
type PCC ¶
type PCC struct {
Must bool
Multi bool
DefaultV []string
Link string
LinkLogical Logical
Rename string
// contains filtered or unexported fields
}
PCC - ParamCheck Config
type ParamModify ¶
ParamModify for ParamAutoLoad
type ParamModifyList ¶
type ParamModifyList map[string]ParamModify
ParamModifyList for ParamAutoLoad
type RuleBuilder ¶
RuleBuilder for check preparation
Click to show internal directories.
Click to hide internal directories.