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

Method JournalIDFromQuery

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

Source from the content-addressed store, hash-verified

145}
146
147func (r *Request) JournalIDFromQuery(w *ResponseWriter, param string) (journal.ID, bool) {
148 s := r.URL.Query().Get(param)
149 if s == "" {
150 return journal.Nil, true
151 }
152 id, err := strconv.ParseInt(s, 10, 64)
153 if err != nil {
154 w.Error(srverr.ErrInvalid("invalid query param %q: %w", param, err))
155 return journal.Nil, false
156 }
157 return journal.ID(id), true
158}
159
160func (r *Request) BoolFromQuery(w *ResponseWriter, param string) (bool, bool) {
161 s := r.URL.Query().Get(param)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected