MCPcopy
hub / github.com/perkeep/perkeep / servePermanodesWithAttr

Method servePermanodesWithAttr

pkg/search/handler.go:629–639  ·  view source on GitHub ↗

servePermanodesWithAttr uses the indexer to search for the permanodes matching the request. The valid values for the "attr" key in the request (i.e the only attributes for a permanode which are actually indexed as such) are "tag" and "title".

(rw http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

627// The valid values for the "attr" key in the request (i.e the only attributes
628// for a permanode which are actually indexed as such) are "tag" and "title".
629func (h *Handler) servePermanodesWithAttr(rw http.ResponseWriter, req *http.Request) {
630 defer httputil.RecoverJSON(rw, req)
631 var wr WithAttrRequest
632 wr.fromHTTP(req)
633 res, err := h.GetPermanodesWithAttr(&wr)
634 if err != nil {
635 httputil.ServeJSONError(rw, err)
636 return
637 }
638 httputil.ReturnJSON(rw, res)
639}
640
641// GetClaims returns the claims on req.Permanode signed by h.owner.
642func (h *Handler) GetClaims(req *ClaimsRequest) (*ClaimsResponse, error) {

Callers

nothing calls this directly

Calls 5

fromHTTPMethod · 0.95
GetPermanodesWithAttrMethod · 0.95
RecoverJSONFunction · 0.92
ServeJSONErrorFunction · 0.92
ReturnJSONFunction · 0.92

Tested by

no test coverage detected