bindstruct

package
v0.0.0-...-c6ea6ab Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultBindConfig default BindConfig
	DefaultBindConfig = NewBindConfig()
)

Functions

func BindStruct

func BindStruct(obj interface{}) martini.Handler

BindStruct martini handler for bind struct with default config

func BindStructWithConfig

func BindStructWithConfig(obj interface{}, config BindConfig) martini.Handler

BindStructWithConfig martini handler for bind struct

func EnsureBindStruct

func EnsureBindStruct(ctx martini.Context, obj interface{}) reflect.Value

EnsureBindStruct ensure martini context mapped struct

Types

type BindConfig

type BindConfig struct {
	DisableBindQuery   bool
	DisableBindParams  bool
	DisableTrimSpace   bool
	DisableGoValidator bool

	// Maximum amount of memory to use when parsing a multipart form.
	// Set this to whatever value you prefer; default is 20 MB.
	MaxMemory int64
}

BindConfig config for bind

func NewBindConfig

func NewBindConfig() BindConfig

NewBindConfig create default BindConfig

Jump to

Keyboard shortcuts

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