MCPcopy
hub / github.com/labstack/echo / PathValuesBinder

Function PathValuesBinder

binder.go:142–156  ·  view source on GitHub ↗

PathValuesBinder creates path parameter value binder

(c *Context)

Source from the content-addressed store, hash-verified

140
141// PathValuesBinder creates path parameter value binder
142func 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

Callers 1

TestPathValuesBinderFunction · 0.85

Calls 1

ParamMethod · 0.80

Tested by 1

TestPathValuesBinderFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…