MCPcopy
hub / github.com/perkeep/perkeep / GetPermanodesWithAttr

Method GetPermanodesWithAttr

pkg/client/client.go:704–723  ·  view source on GitHub ↗

GetPermanodesWithAttr searches for permanodes that match the given search request. The Fuzzy option in the request must not be set, and the Attribute option must be set. Only indexed attributes may be queried.

(ctx context.Context, req *search.WithAttrRequest)

Source from the content-addressed store, hash-verified

702// must be set.
703// Only indexed attributes may be queried.
704func (c *Client) GetPermanodesWithAttr(ctx context.Context, req *search.WithAttrRequest) (*search.WithAttrResponse, error) {
705 sr, err := c.SearchRoot()
706 if err != nil {
707 return nil, err
708 }
709 url := sr + req.URLSuffix()
710 hreq := c.newRequest(ctx, "GET", url)
711 hres, err := c.expect2XX(hreq)
712 if err != nil {
713 return nil, err
714 }
715 res := new(search.WithAttrResponse)
716 if err := httputil.DecodeJSON(hres, res); err != nil {
717 return nil, err
718 }
719 if err := res.Err(); err != nil {
720 return nil, err
721 }
722 return res, nil
723}
724
725func (c *Client) Describe(ctx context.Context, req *search.DescribeRequest) (*search.DescribeResponse, error) {
726 sr, err := c.SearchRoot()

Callers 3

condRefreshMethod · 0.45
condRefreshMethod · 0.45
mainFunction · 0.45

Calls 6

SearchRootMethod · 0.95
newRequestMethod · 0.95
expect2XXMethod · 0.95
DecodeJSONFunction · 0.92
URLSuffixMethod · 0.45
ErrMethod · 0.45

Tested by

no test coverage detected