decoder

package
v0.0.0-...-d6d65d7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedType = errors.New("decoder: unsupported type")
	ErrTagNotFound     = errors.New("decoder: tag not found")
)

Functions

This section is empty.

Types

type Args

type Args fasthttp.Args

func (*Args) Get

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

func (*Args) Values

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

type CachedDecoder

type CachedDecoder[V any] struct {
	// contains filtered or unexported fields
}

func NewCached

func NewCached[V any](v V, tag string) (*CachedDecoder[V], error)

func (*CachedDecoder[V]) Decode

func (d *CachedDecoder[V]) Decode(data Getter, v *V) error

func (*CachedDecoder[V]) DecodeValue

func (d *CachedDecoder[V]) DecodeValue(data Getter, v reflect.Value) error

type Decoder

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

func New

func New(tag string) *Decoder

func (*Decoder) Decode

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

type Getter

type Getter interface {
	Get(key string) string
	Values(key string) []string
}
type Header fasthttp.RequestHeader

func (*Header) Get

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

func (*Header) Values

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

type Map

type Map map[string][]string

func (Map) Get

func (m Map) Get(key string) string

func (Map) Values

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

type Params

type Params httprouter.Params

func (Params) Get

func (ps Params) Get(key string) string

func (Params) Values

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳