MCPcopy Create free account
hub / github.com/brimdata/super / BoolFromQuery

Method BoolFromQuery

service/request.go:160–171  ·  view source on GitHub ↗
(w *ResponseWriter, param string)

Source from the content-addressed store, hash-verified

158}
159
160func (r *Request) BoolFromQuery(w *ResponseWriter, param string) (bool, bool) {
161 s := r.URL.Query().Get(param)
162 if s == "" {
163 return false, true
164 }
165 b, err := strconv.ParseBool(s)
166 if err != nil {
167 w.Error(srverr.ErrInvalid("invalid query param %q: %w", s, err))
168 return false, false
169 }
170 return b, true
171}
172
173func (r *Request) Unmarshal(w *ResponseWriter, body any, templates ...any) bool {
174 format, ok := r.format(w, DefaultFormat)

Callers 4

handleQueryFunction · 0.80
handleCompactFunction · 0.80
handleVacateFunction · 0.80
handleVacuumFunction · 0.80

Calls 4

ErrInvalidFunction · 0.92
GetMethod · 0.65
QueryMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected