MCPcopy
hub / github.com/perkeep/perkeep / fromHTTPGet

Method fromHTTPGet

pkg/search/describe.go:329–345  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

327}
328
329func (dr *DescribeRequest) fromHTTPGet(req *http.Request) {
330 req.ParseForm()
331 if vv := req.Form["blobref"]; len(vv) > 1 {
332 for _, brs := range vv {
333 if br, ok := blob.Parse(brs); ok {
334 dr.BlobRefs = append(dr.BlobRefs, br)
335 } else {
336 panic(httputil.InvalidParameterError("blobref"))
337 }
338 }
339 } else {
340 dr.BlobRef = httputil.MustGetBlobRef(req, "blobref")
341 }
342 dr.Depth = httputil.OptionalInt(req, "depth")
343 dr.MaxDirChildren = httputil.OptionalInt(req, "maxdirchildren")
344 dr.At = types.ParseTime3339OrZero(req.FormValue("at"))
345}
346
347// PermanodeFile returns in path the blobref of the described permanode
348// and the blobref of its File camliContent.

Callers 1

fromHTTPMethod · 0.95

Calls 4

ParseFunction · 0.92
InvalidParameterErrorTypeAlias · 0.92
MustGetBlobRefFunction · 0.92
OptionalIntFunction · 0.92

Tested by

no test coverage detected