MCPcopy
hub / github.com/perkeep/perkeep / fromHTTP

Method fromHTTP

pkg/search/describe.go:311–320  ·  view source on GitHub ↗

fromHTTP panics with an httputil value on failure

(req *http.Request)

Source from the content-addressed store, hash-verified

309
310// fromHTTP panics with an httputil value on failure
311func (dr *DescribeRequest) fromHTTP(req *http.Request) {
312 switch {
313 case httputil.IsGet(req):
314 dr.fromHTTPGet(req)
315 case req.Method == "POST":
316 dr.fromHTTPPost(req)
317 default:
318 panic("Unsupported method")
319 }
320}
321
322func (dr *DescribeRequest) fromHTTPPost(req *http.Request) {
323 err := json.NewDecoder(req.Body).Decode(dr)

Callers 1

serveDescribeMethod · 0.95

Calls 3

fromHTTPGetMethod · 0.95
fromHTTPPostMethod · 0.95
IsGetFunction · 0.92

Tested by

no test coverage detected