PathValuesBinder creates path parameter value binder
(c *Context)
| 140 | |
| 141 | // PathValuesBinder creates path parameter value binder |
| 142 | func PathValuesBinder(c *Context) *ValueBinder { |
| 143 | return &ValueBinder{ |
| 144 | failFast: true, |
| 145 | ValueFunc: c.Param, |
| 146 | ValuesFunc: func(sourceParam string) []string { |
| 147 | // path parameter should not have multiple values so getting values does not make sense but lets not error out here |
| 148 | value := c.Param(sourceParam) |
| 149 | if value == "" { |
| 150 | return nil |
| 151 | } |
| 152 | return []string{value} |
| 153 | }, |
| 154 | ErrorFunc: NewBindingError, |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | // FormFieldBinder creates form field value binder |
| 159 | // For all requests, FormFieldBinder parses the raw query from the URL and uses query params as form fields |
searching dependent graphs…