(w *ResponseWriter, param string)
| 145 | } |
| 146 | |
| 147 | func (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 | |
| 160 | func (r *Request) BoolFromQuery(w *ResponseWriter, param string) (bool, bool) { |
| 161 | s := r.URL.Query().Get(param) |
nothing calls this directly
no test coverage detected