MCPcopy Index your code
hub / github.com/perkeep/perkeep / hasValueConstraint

Method hasValueConstraint

pkg/search/query.go:1666–1677  ·  view source on GitHub ↗

hasValueConstraint returns true if one or more constraints that check an attribute's value are set.

()

Source from the content-addressed store, hash-verified

1664
1665// hasValueConstraint returns true if one or more constraints that check an attribute's value are set.
1666func (c *PermanodeConstraint) hasValueConstraint() bool {
1667 // If a field has been added or removed, update this after adding the new field to the return statement if necessary.
1668 const expectedFields = 15
1669 if numPermanodeFields != expectedFields {
1670 panic(fmt.Sprintf("PermanodeConstraint field count changed (now %v rather than %v)", numPermanodeFields, expectedFields))
1671 }
1672 return c.Value != "" ||
1673 c.ValueMatches != nil ||
1674 c.ValueMatchesInt != nil ||
1675 c.ValueMatchesFloat != nil ||
1676 c.ValueInSet != nil
1677}
1678
1679func (c *PermanodeConstraint) blobMatches(ctx context.Context, s *search, br blob.Ref, bm camtypes.BlobMeta) (ok bool, err error) {
1680 if bm.CamliType != schema.TypePermanode {

Callers 2

checkValidMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected