MCPcopy Create free account
hub / github.com/kataras/iris / FormFieldWithConf

Function FormFieldWithConf

middleware/methodoverride/methodoverride.go:125–141  ·  view source on GitHub ↗

FormFieldWithConf same as `FormField` but it accepts the application's configuration to parse the form based on the app core configuration.

(fieldName string, conf context.ConfigurationReadOnly)

Source from the content-addressed store, hash-verified

123// FormFieldWithConf same as `FormField` but it accepts the application's
124// configuration to parse the form based on the app core configuration.
125func FormFieldWithConf(fieldName string, conf context.ConfigurationReadOnly) Option {
126 var (
127 postMaxMemory int64 = 32 << 20 // 32 MB
128 resetBody = false
129 )
130
131 if conf != nil {
132 postMaxMemory = conf.GetPostMaxMemory()
133 resetBody = conf.GetDisableBodyConsumptionOnUnmarshal()
134 }
135
136 getter := func(w http.ResponseWriter, r *http.Request) string {
137 return context.FormValueDefault(r, fieldName, "", postMaxMemory, resetBody)
138 }
139
140 return Getter(getter)
141}
142
143// Query specifies a url parameter name to use to determinate the method
144// to override the POST methos with.

Callers 1

FormFieldFunction · 0.85

Calls 4

FormValueDefaultFunction · 0.92
GetterFunction · 0.85
GetPostMaxMemoryMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…