in lib/storage/storage.go [228:266]
func matchOrFilters(orFilters []Filter, p proto.Message) bool {
for _, f := range orFilters {
a := strings.ToLower(f.extract(p))
b := f.value
switch {
// Starts with
case f.compare == "sw" && strings.HasPrefix(a, b):
return true
// Equals
case f.compare == "eq" && a == b:
return true
// Not equals
case f.compare == "ne" && a != b:
return true
// Contains
case f.compare == "co" && strings.Contains(a, b):
return true
// Ends with
case f.compare == "ew" && strings.HasSuffix(a, b):
return true
// Present
case f.compare == "pr" && len(a) > 0:
return true
// Greater than
case f.compare == "gt" && strings.Compare(a, b) > 0:
return true
// Greater than or equal to
case f.compare == "ge" && strings.Compare(a, b) >= 0:
return true
// Less than
case f.compare == "lt" && strings.Compare(a, b) < 0:
return true
// Less than or equal to
case f.compare == "le" && strings.Compare(a, b) <= 0:
return true
}
}
return false
}