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

Function BindPathValues

bind.go:44–53  ·  view source on GitHub ↗

BindPathValues binds path parameter values to bindable object

(c *Context, target any)

Source from the content-addressed store, hash-verified

42
43// BindPathValues binds path parameter values to bindable object
44func BindPathValues(c *Context, target any) error {
45 params := map[string][]string{}
46 for _, param := range c.PathValues() {
47 params[param.Name] = []string{param.Value}
48 }
49 if err := bindData(target, params, "param", nil); err != nil {
50 return ErrBadRequest.Wrap(err)
51 }
52 return nil
53}
54
55// BindQueryParams binds query params to bindable object
56func BindQueryParams(c *Context, target any) error {

Callers 1

BindMethod · 0.85

Calls 3

bindDataFunction · 0.85
PathValuesMethod · 0.80
WrapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…