httputil

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedMimetype = fmt.Errorf("Unsupported content type")

Functions

func Unmarshal

func Unmarshal(req *router.Request, entity interface{}, opts ...Option) error

Unmarshal requests with common entity types

func UnmarshalWithConfig

func UnmarshalWithConfig(req *router.Request, entity interface{}, conf Config) error

Unmarshal requests with common entity types:

  • application/json
  • application/x-www-form-urlencoded
  • multipart/form-data

Types

type Config

type Config struct {
	MaxMem int64
}

func (Config) WithOptions

func (c Config) WithOptions(opts []Option) Config

type Option

type Option func(Config) Config

func MaximumMemory

func MaximumMemory(v int64) Option

The maximum amount of memory that is permitted to buffer input data per request before it is offloaded to temporary disk storage. This is mainly only relevant to multipart file data.

Jump to

Keyboard shortcuts

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