Documentation ¶
Index ¶
- Constants
- Variables
- func BuildJsonValueBinder(rv reflect.Value) structproto.ValueBinder
- func Indirect(v interface{}) (reflect.Value, error)
- type BodyBinder
- type ContentProcessRegistry
- type ContentProcessService
- type ContentProcessor
- type ContentType
- type HttpArg
- type JsonValueBinder
- type MultipartContentBinder
- type MultipartProcessor
- type QueryArgsBinder
- type StringContentProcessor
- type Validatable
Constants ¶
View Source
const ( HEADER_CONTENT_DISPOSITION = "Content-Disposition" HEADER_CONTENT_TYPE = "Content-Type" True = "true" JsonTagName = "json" MultipartTagName = "multipart" )
Variables ¶
View Source
var ( ContentProcessServiceInstance = new(ContentProcessService) ContentProcessRegistryService = newContentProcessRegistry(ContentProcessServiceInstance) )
Functions ¶
func BuildJsonValueBinder ¶
func BuildJsonValueBinder(rv reflect.Value) structproto.ValueBinder
Types ¶
type BodyBinder ¶ added in v0.2.1
type BodyBinder struct {
// contains filtered or unexported fields
}
func NewBodyBinder ¶ added in v0.2.1
func NewBodyBinder(content []byte) *BodyBinder
func (*BodyBinder) Bind ¶ added in v0.2.1
func (binder *BodyBinder) Bind(field structproto.FieldInfo, rv reflect.Value) error
Bind implements structproto.StructBinder.
func (*BodyBinder) Deinit ¶ added in v0.2.1
func (binder *BodyBinder) Deinit(context *structproto.StructProtoContext) error
Deinit implements structproto.StructBinder.
func (*BodyBinder) Init ¶ added in v0.2.1
func (binder *BodyBinder) Init(context *structproto.StructProtoContext) error
Init implements structproto.StructBinder.
type ContentProcessRegistry ¶
type ContentProcessRegistry struct {
// contains filtered or unexported fields
}
func (*ContentProcessRegistry) Get ¶
func (registry *ContentProcessRegistry) Get(mediatype string) ContentProcessor
func (*ContentProcessRegistry) RegisterContentProcessor ¶
func (registry *ContentProcessRegistry) RegisterContentProcessor(mediatype string, processor ContentProcessor) bool
func (*ContentProcessRegistry) Setup ¶
func (registry *ContentProcessRegistry) Setup( queryArgsProcessor StringContentProcessor, processors map[string]ContentProcessor)
type ContentProcessService ¶
type ContentProcessService struct {
// contains filtered or unexported fields
}
func (*ContentProcessService) Process ¶
func (service *ContentProcessService) Process(target interface{}, content []byte, contentType string) error
func (*ContentProcessService) ProcessQueryArgs ¶
func (service *ContentProcessService) ProcessQueryArgs(target interface{}, content string) error
type ContentProcessor ¶
type ContentType ¶
type ContentType struct {
// contains filtered or unexported fields
}
func ParseContentType ¶
func ParseContentType(contentType string) (ContentType, error)
func (ContentType) IsMultipartTypes ¶
func (t ContentType) IsMultipartTypes() bool
type HttpArg ¶
type HttpArg struct {
// contains filtered or unexported fields
}
func NewHttpArg ¶
func NewHttpArg(target interface{}) *HttpArg
func (*HttpArg) Process ¶
func (arg *HttpArg) Process(content []byte, processor ContentProcessor) error
func (*HttpArg) ProcessContent ¶
func (*HttpArg) ProcessQueryString ¶
type JsonValueBinder ¶
func (JsonValueBinder) Bind ¶
func (binder JsonValueBinder) Bind(content interface{}) error
type MultipartContentBinder ¶
type MultipartContentBinder struct {
// contains filtered or unexported fields
}
func (*MultipartContentBinder) Bind ¶
func (binder *MultipartContentBinder) Bind(field structproto.FieldInfo, rv reflect.Value) error
func (*MultipartContentBinder) Deinit ¶
func (binder *MultipartContentBinder) Deinit(context *structproto.StructProtoContext) error
func (*MultipartContentBinder) Init ¶
func (binder *MultipartContentBinder) Init(context *structproto.StructProtoContext) error
type MultipartProcessor ¶
type MultipartProcessor struct {
// contains filtered or unexported fields
}
func (*MultipartProcessor) Process ¶
func (p *MultipartProcessor) Process(content []byte, target interface{}) error
type QueryArgsBinder ¶
type QueryArgsBinder struct {
// contains filtered or unexported fields
}
func NewQueryArgsBinder ¶
func NewQueryArgsBinder(values url.Values) *QueryArgsBinder
func (*QueryArgsBinder) Bind ¶
func (binder *QueryArgsBinder) Bind(field structproto.FieldInfo, rv reflect.Value) error
func (*QueryArgsBinder) Deinit ¶
func (binder *QueryArgsBinder) Deinit(context *structproto.StructProtoContext) error
func (*QueryArgsBinder) Init ¶
func (binder *QueryArgsBinder) Init(context *structproto.StructProtoContext) error
type StringContentProcessor ¶
type Validatable ¶
type Validatable interface {
Validate() error
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.