MCPcopy Create free account
hub / github.com/BryanMwangi/pine / BindQuery

Method BindQuery

bind.go:42–49  ·  view source on GitHub ↗

BindQuery binds the specified query value of a request.

(key string, v interface{})

Source from the content-addressed store, hash-verified

40
41// BindQuery binds the specified query value of a request.
42func (c *Ctx) BindQuery(key string, v interface{}) error {
43 param := c.Query(key)
44 if param == "" {
45 return ErrValidation
46 }
47
48 return bind(param, v)
49}
50
51// Internal helper function to validate the bind
52// requires the input in this case is the key of the param or query

Callers 3

TestBindQuery_SuccessFunction · 0.80
TestBindQuery_NotFoundFunction · 0.80
mainFunction · 0.80

Calls 2

QueryMethod · 0.95
bindFunction · 0.85

Tested by 2

TestBindQuery_SuccessFunction · 0.64
TestBindQuery_NotFoundFunction · 0.64