Documentation
¶
Overview ¶
Package body resolves whole or named request bodies to planned Go types.
Index ¶
- func MultipartValue(form *multipart.Form, target reflect.Type, name string) (any, bool)
- type Decoder
- type DecoderFunc
- type DecoderRegistry
- type FieldDecoder
- type Option
- type Source
- func (s *Source) CaptureSource(ctx context.Context, target reflect.Type, name string) (any, bool, error)
- func (s *Source) DefaultCacheable() bool
- func (s *Source) Kind() string
- func (s *Source) Locate(*structology.State) locator.Locator
- func (s *Source) Priority() int
- func (s *Source) Value(_ context.Context, target reflect.Type, name string) (any, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DecoderFunc ¶ added in v0.3.0
type DecoderRegistry ¶ added in v0.3.0
type DecoderRegistry struct {
// contains filtered or unexported fields
}
func NewDecoderRegistry ¶ added in v0.3.0
func NewDecoderRegistry() *DecoderRegistry
func (*DecoderRegistry) Lookup ¶ added in v0.3.0
func (r *DecoderRegistry) Lookup(mediaType string) (Decoder, bool)
func (*DecoderRegistry) Register ¶ added in v0.3.0
func (r *DecoderRegistry) Register(mediaType string, decoder Decoder)
type FieldDecoder ¶ added in v0.3.0
type Option ¶
type Option func(*Source)
func WithDecoders ¶ added in v0.3.0
func WithDecoders(decoders *DecoderRegistry) Option
func WithExactFieldNames ¶
func WithExactFieldNames() Option
func WithMultipartForm ¶ added in v0.3.0
WithMultipartForm supplies a transport-owned parsed form. The transport retains responsibility for removing any temporary files after the invocation.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) CaptureSource ¶
func (s *Source) CaptureSource(ctx context.Context, target reflect.Type, name string) (any, bool, error)
CaptureSource retains the selected JSON bytes before decoding loses omission, null or number precision. Other media keep this provider's normal source-type conversion. ReplayPlan owns selection; the body provider owns JSON extraction.
func (*Source) DefaultCacheable ¶
Click to show internal directories.
Click to hide internal directories.