(op string)
| 140 | } |
| 141 | |
| 142 | func getComparatorType(op string) (OperatorType, error) { |
| 143 | switch op { |
| 144 | case "=", "eq": |
| 145 | return ComparatorTypeEqual, nil |
| 146 | case "!=": |
| 147 | return ComparatorTypeNotEqual, nil |
| 148 | case ">": |
| 149 | return ComparatorTypeGreater, nil |
| 150 | case ">=": |
| 151 | return ComparatorTypeGreaterEqual, nil |
| 152 | case "<": |
| 153 | return ComparatorTypeLess, nil |
| 154 | case "<=": |
| 155 | return ComparatorTypeLessEqual, nil |
| 156 | default: |
| 157 | return ComparatorTypeEqual, errors.Errorf("invalid comparator %q", op) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | // normalizeFilter will replace all quoted string with ? and return the list of quoted strings. |
| 162 | func normalizeFilter(filter string) (string, []string, error) { |
no test coverage detected