Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CookiePrinter ¶
type CookiePrinter struct {
// contains filtered or unexported fields
}
func NewCookiePrinter ¶
func NewCookiePrinter(w http.ResponseWriter) *CookiePrinter
func (*CookiePrinter) Print ¶
func (p *CookiePrinter) Print(v any) error
func (*CookiePrinter) Set ¶
func (p *CookiePrinter) Set(key string, value any)
func (*CookiePrinter) SetField ¶
func (p *CookiePrinter) SetField(key string, value any, field reflect.StructField)
type CookieScanner ¶
type CookieScanner struct {
// contains filtered or unexported fields
}
A scanner to scan http cookies for a url from a `http.CookieJar` to a struct
func NewCookieScanner ¶
func NewCookieScanner(cookies []*http.Cookie) *CookieScanner
func (CookieScanner) Get ¶
func (v CookieScanner) Get(key string) any
func (*CookieScanner) Scan ¶
func (s *CookieScanner) Scan(v any) error
Scans the cookie values onto v
type FormScanner ¶
A scanner to scan form values from a `*url.Values` to a struct
func NewFormScanner ¶
func NewFormScanner(v *url.Values) *FormScanner
func (FormScanner) Get ¶
func (v FormScanner) Get(key string) any
type HeaderPrinter ¶
type HeaderPrinter struct {
// contains filtered or unexported fields
}
func NewHeaderPrinter ¶
func NewHeaderPrinter(w http.ResponseWriter) *HeaderPrinter
func (*HeaderPrinter) Print ¶
func (p *HeaderPrinter) Print(v any) error
func (*HeaderPrinter) Set ¶
func (p *HeaderPrinter) Set(key string, value any)
type HeaderScanner ¶
A scanner to scan header values from an `http.Header` to a struct
func NewHeaderScanner ¶
func NewHeaderScanner(h *http.Header) *HeaderScanner
func (*HeaderScanner) Get ¶
func (h *HeaderScanner) Get(key string) any
type JSONPrinter ¶ added in v0.2.1
type JSONPrinter struct {
// contains filtered or unexported fields
}
func NewJSONPrinter ¶ added in v0.2.1
func NewJSONPrinter(w http.ResponseWriter) *JSONPrinter
func (*JSONPrinter) Print ¶ added in v0.2.1
func (p *JSONPrinter) Print(v any) error
type JSONScanner ¶
type JSONScanner struct {
// contains filtered or unexported fields
}
A scanner to scan json value from an `io.Reader` to a struct
func NewJSONScanner ¶
func NewJSONScanner(r io.Reader) *JSONScanner
func NewJSONScannerFromBytes ¶
func NewJSONScannerFromBytes(b []byte) *JSONScanner
type MultipartParser ¶
type MultipartScanner ¶
type MultipartScanner struct {
// contains filtered or unexported fields
}
A scanner to scan multipart form values, files, from a `*scanner.MultipartValues` to a struct You can create a `*scanner.MultipartValues` instance with the `scanner.MultipartValuesFromParser` function.
func NewMultipartScanner ¶
func NewMultipartScanner(v *MultipartValues) *MultipartScanner
func (*MultipartScanner) Scan ¶
func (s *MultipartScanner) Scan(v any) error
Scans the multipart form data onto v
type MultipartValues ¶
func MultipartValuesFromParser ¶
func MultipartValuesFromParser(p MultipartParser, size int64, names ...string) (*MultipartValues, error)
MultipartValuesFromParser takes a generic parser that is usually an `*http.Request` and returns `*scanner.MultipartValues` to use it with a `scanner.MultipartScanner` or `scanner.ImageScanner`
func (MultipartValues) Get ¶
func (v MultipartValues) Get(key string) any
type PathScanner ¶
A scanner to scan path parameters from a `*http.Request` to a struct
func NewPathScanner ¶
func NewPathScanner(req *http.Request) *PathScanner
func (PathScanner) Get ¶
func (v PathScanner) Get(key string) any
type PipePrinter ¶
type PipePrinter []Printer
func NewPipePrinter ¶
func NewPipePrinter(printers ...Printer) *PipePrinter
func (*PipePrinter) Print ¶
func (s *PipePrinter) Print(v any) error
Runs given printers in sequence
type PipeScanner ¶
type PipeScanner []Scanner
func NewPipeScanner ¶
func NewPipeScanner(scanners ...Scanner) *PipeScanner
type QueryScanner ¶
A scanner to scan url query values from a `*url.Values` to a struct
func NewQueryScanner ¶
func NewQueryScanner(v url.Values) *QueryScanner
func (QueryScanner) Get ¶
func (v QueryScanner) Get(key string) any