bindStruct

package
v1.0.0-...-4f7f1ef Latest Latest
Warning

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

Go to latest
Published: May 31, 2016 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultConfig default Config for binding
	DefaultConfig = NewConfig()
)
View Source
var (
	ErrorInjectorNotFound = errutil.NewFactory("injector not found, bindStruct require gin-injector middleware")
)

errors

Functions

func BindStruct

func BindStruct(obj interface{}) gin.HandlerFunc

BindStruct martini handler for bind struct with default config

func BindStructWithConfig

func BindStructWithConfig(obj interface{}, config Config) gin.HandlerFunc

BindStructWithConfig martini handler for bind struct

Types

type Config

type Config 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
}

Config for binding

func NewConfig

func NewConfig() Config

NewConfig create default BindConfig

Jump to

Keyboard shortcuts

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