Versions in this module Expand all Collapse all v0 v0.20.0 Oct 16, 2023 Changes in this version + const DefaultTagName + const OperationBody + const OperationForm + const OperationHeader + const OperationIgnore + const OperationPath + const OperationQuery + const OperationRecurse + const StructOptionMapTag + var ErrCoerceInvalid = types.ErrCoerceInvalid + var ErrCoerceOverflow = types.ErrCoerceOverflow + var ErrCoerceUnknown = types.ErrCoerceUnknown + var ErrCoerceUnsupported = types.ErrCoerceUnsupported + var IgnoreDecodeValue = instruct.IgnoreDecodeValue + func CustomDecode(r *http.Request, data any, options ...AnyOption) error + func CustomDecodeType(r *http.Request, options ...AnyTypeOption) (T, error) + func Decode(r *http.Request, data any, options ...AnyOption) error + func DecodeType(r *http.Request, options ...AnyTypeOption) (T, error) + type AnyOption = options.AnyOption[*http.Request, DecodeContext] + type AnyTypeOption = options.AnyTypeOption[*http.Request, DecodeContext] + type BodyDecoder interface + Unmarshal func(ctx DecodeContext, typeParam string, r *http.Request, data any) (bool, any, error) + func NewDefaultBodyDecoder() BodyDecoder + type CoerceError = types.CoerceError + type DecodeContext interface + AllowReadBody func() bool + BodyDecoder func() BodyDecoder + DecodedBody func() + EnsureAllFormUsed func() bool + EnsureAllQueryUsed func() bool + IsBodyDecoded func() bool + PathValue func() PathValue + SliceSplitSeparator func() string + type DecodeOperation = instruct.DecodeOperation[*http.Request, DecodeContext] + type DecodeOperationBody struct + func (d *DecodeOperationBody) Decode(ctx DecodeContext, r *http.Request, isList bool, field reflect.Value, tag *Tag) (bool, any, error) + type DecodeOperationForm struct + func (d *DecodeOperationForm) Decode(ctx DecodeContext, r *http.Request, isList bool, field reflect.Value, tag *Tag) (bool, any, error) + func (d *DecodeOperationForm) Validate(ctx DecodeContext, r *http.Request) error + type DecodeOperationHeader struct + func (d *DecodeOperationHeader) Decode(ctx DecodeContext, r *http.Request, isList bool, field reflect.Value, tag *Tag) (bool, any, error) + type DecodeOperationPath struct + func (d *DecodeOperationPath) Decode(ctx DecodeContext, r *http.Request, isList bool, field reflect.Value, tag *Tag) (bool, any, error) + type DecodeOperationQuery struct + func (d *DecodeOperationQuery) Decode(ctx DecodeContext, r *http.Request, isList bool, field reflect.Value, tag *Tag) (bool, any, error) + func (d *DecodeOperationQuery) Validate(ctx DecodeContext, r *http.Request) error + type DecodeOption = options.DecodeOption[*http.Request, DecodeContext, decodeOptions] + type Decoder struct + func NewCustomDecoder(options ...DefaultOption) *Decoder + func NewDecoder(options ...DefaultOption) *Decoder + func (d *Decoder) Decode(r *http.Request, data any, options ...DecodeOption) error + type DefaultAndDecodeOption = options.DefaultAndDecodeOption[*http.Request, DecodeContext, defaultOptions, decodeOptions] + type DefaultAndTypeDefaultDecodeOption = options.DefaultAndTypeDefaultDecodeOption[*http.Request, DecodeContext, decodeOptions, decodeOptions] + type DefaultAndTypeDefaultOption = options.DefaultAndTypeDefaultOption[*http.Request, DecodeContext, defaultOptions, typeDefaultOptions] + func WithBodyDecoder(bodyDecoder BodyDecoder) DefaultAndTypeDefaultOption + func WithDecodeOperation(name string, operation DecodeOperation) DefaultAndTypeDefaultOption + func WithDefaultDecodeOperations() DefaultAndTypeDefaultOption + func WithDefaultMapTags(dataForType any, tags MapTags) DefaultAndTypeDefaultOption + func WithDefaultMapTagsType(typ reflect.Type, tags MapTags) DefaultAndTypeDefaultOption + func WithDefaultRequired(defaultRequired bool) DefaultAndTypeDefaultOption + func WithFieldNameMapper(fieldNameMapper FieldNameMapper) DefaultAndTypeDefaultOption + func WithPathValue(pathValue PathValue) DefaultAndTypeDefaultOption + func WithResolver(resolver Resolver) DefaultAndTypeDefaultOption + func WithSliceSplitSeparator(sep string) DefaultAndTypeDefaultOption + func WithStructInfoCache(cache bool) DefaultAndTypeDefaultOption + func WithTagName(tagName string) DefaultAndTypeDefaultOption + type DefaultOption = options.DefaultOption[*http.Request, DecodeContext, defaultOptions] + type FieldNameMapper = instruct.FieldNameMapper + type FullOption = options.FullOption[*http.Request, DecodeContext, defaultOptions, typeDefaultOptions, decodeOptions, decodeOptions] + func WithAllowReadBody(allowReadBody bool) FullOption + func WithEnsureAllFormUsed(ensureAllFormUsed bool) FullOption + func WithEnsureAllQueryUsed(ensureAllQueryUsed bool) FullOption + type InvalidDecodeError = types.InvalidDecodeError + type MapTags = instruct.MapTags + type OperationNotSupportedError = types.OperationNotSupportedError + type PathValue interface + GetRequestPath func(r *http.Request, name string) (found bool, value any, err error) + type PathValueFunc func(r *http.Request, name string) (found bool, value any, err error) + func (p PathValueFunc) GetRequestPath(r *http.Request, name string) (found bool, value any, err error) + type RequiredError = types.RequiredError + type Resolver = instruct.Resolver + type StructOption = instruct.StructOption + type Tag = instruct.Tag + type TypeDecodeOption = options.TypeDecodeOption[*http.Request, DecodeContext, decodeOptions] + type TypeDecoder struct + func NewCustomTypeDecoder(options ...TypeDefaultOption) *TypeDecoder[T] + func NewTypeDecoder(options ...TypeDefaultOption) *TypeDecoder[T] + func (d *TypeDecoder[T]) Decode(r *http.Request, options ...TypeDecodeOption) (T, error) + type TypeDefaultAndDecodeOption = options.TypeDefaultAndDecodeOption[*http.Request, DecodeContext, typeDefaultOptions, decodeOptions] + func WithMapTags(tags MapTags) TypeDefaultAndDecodeOption + type TypeDefaultAndTypeDecodeOption = options.TypeDefaultAndTypeDecodeOption[*http.Request, DecodeContext, typeDefaultOptions, decodeOptions] + type TypeDefaultOption = options.TypeDefaultOption[*http.Request, DecodeContext, typeDefaultOptions] + type ValuesNotUsedError = types.ValuesNotUsedError