decoder

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedType = errors.New("decoder: unsupported type")

Functions

This section is empty.

Types

type ArgsDecoder

type ArgsDecoder struct {
	// contains filtered or unexported fields
}

func NewArgsDecoder

func NewArgsDecoder(v interface{}, tag string) (*ArgsDecoder, error)

func (*ArgsDecoder) Decode

func (d *ArgsDecoder) Decode(data *fasthttp.Args, v interface{}) error

type ArgsGetter

type ArgsGetter fasthttp.Args

func (*ArgsGetter) Get

func (ps *ArgsGetter) Get(key string) string

func (*ArgsGetter) Values

func (ps *ArgsGetter) Values(key string) []string

type CachedDecoder

type CachedDecoder struct {
	// contains filtered or unexported fields
}

func NewCachedDecoder

func NewCachedDecoder(v interface{}, tag string) (*CachedDecoder, error)

func (*CachedDecoder) Decode

func (d *CachedDecoder) Decode(data Getter, v interface{}) error

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(tag string) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(data Getter, v any) error

type Getter

type Getter interface {
	Get(string) string
	Values(string) []string
}

type HeaderDecoder

type HeaderDecoder struct {
	// contains filtered or unexported fields
}

func NewHeaderDecoder

func NewHeaderDecoder(v interface{}, tag string) (*HeaderDecoder, error)

func (*HeaderDecoder) Decode

func (d *HeaderDecoder) Decode(data *fasthttp.RequestHeader, v interface{}) error

type HeaderGetter

type HeaderGetter fasthttp.RequestHeader

func (*HeaderGetter) Get

func (ps *HeaderGetter) Get(key string) string

func (*HeaderGetter) Values

func (ps *HeaderGetter) Values(key string) []string

type MapGetter

type MapGetter map[string][]string

func (MapGetter) Get

func (m MapGetter) Get(key string) string

func (MapGetter) Values

func (m MapGetter) Values(key string) []string

type ParamsDecoder

type ParamsDecoder struct {
	// contains filtered or unexported fields
}

func NewParamsDecoder

func NewParamsDecoder(v interface{}, tag string) (*ParamsDecoder, error)

func (*ParamsDecoder) Decode

func (d *ParamsDecoder) Decode(data []httprouter.Param, v interface{}) error

type ParamsGetter

type ParamsGetter []httprouter.Param

func (ParamsGetter) Get

func (ps ParamsGetter) Get(key string) string

func (ParamsGetter) Values

func (ps ParamsGetter) Values(key string) []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL