Versions in this module Expand all Collapse all v0 v0.1.1 Oct 15, 2023 Changes in this version + func Bind(req *protocol.Request, obj interface{}, pathParams param.Params) error + func BindAndValidate(req *protocol.Request, obj interface{}, pathParams param.Params) error + func Validate(obj interface{}) error + type BindConfig struct + DisableDefaultTag bool + DisableStructFieldResolve bool + EnableDecoderDisallowUnknownFields bool + EnableDecoderUseNumber bool + LooseZeroMode bool + TypeUnmarshalFuncs map[reflect.Type]inDecoder.CustomizeDecodeFunc + Validator StructValidator + func NewBindConfig() *BindConfig + func (config *BindConfig) MustRegTypeUnmarshal(t reflect.Type, ...) + func (config *BindConfig) RegTypeUnmarshal(t reflect.Type, fn inDecoder.CustomizeDecodeFunc) error + func (config *BindConfig) UseStdJSONUnmarshaler() + func (config *BindConfig) UseThirdPartyJSONUnmarshaler(fn func(data []byte, v interface{}) error) + type Binder interface + Bind func(*protocol.Request, interface{}, param.Params) error + BindAndValidate func(*protocol.Request, interface{}, param.Params) error + BindForm func(*protocol.Request, interface{}) error + BindHeader func(*protocol.Request, interface{}) error + BindJSON func(*protocol.Request, interface{}) error + BindPath func(*protocol.Request, interface{}, param.Params) error + BindProtobuf func(*protocol.Request, interface{}) error + BindQuery func(*protocol.Request, interface{}) error + Name func() string + func DefaultBinder() Binder + func NewDefaultBinder(config *BindConfig) Binder + type StructValidator interface + Engine func() interface{} + ValidateStruct func(interface{}) error + ValidateTag func() string + func DefaultValidator() StructValidator + func NewValidator(config *ValidateConfig) StructValidator + type ValidateConfig struct + ErrFactory ValidateErrFactory + ValidateTag string + func NewValidateConfig() *ValidateConfig + func (config *ValidateConfig) MustRegValidateFunc(funcName string, fn func(args ...interface{}) error, force ...bool) + func (config *ValidateConfig) SetValidatorErrorFactory(errFactory ValidateErrFactory) + func (config *ValidateConfig) SetValidatorTag(tag string) + type ValidateErrFactory func(fieldSelector, msg string) error