1
0
mirror of https://github.com/astaxie/beego.git synced 2024-09-28 21:01:49 +00:00
Beego/param/options.go
2017-04-24 02:35:04 +03:00

26 lines
425 B
Go

package param
import (
"fmt"
)
var IsRequired MethodParamOption = func(p *MethodParam) {
p.required = true
}
var InHeader MethodParamOption = func(p *MethodParam) {
p.location = header
}
var InBody MethodParamOption = func(p *MethodParam) {
p.location = body
}
func Default(defValue interface{}) MethodParamOption {
return func(p *MethodParam) {
if defValue != nil {
p.defValue = fmt.Sprint(defValue)
}
}
}