MCPcopy Create free account
hub / github.com/bytebase/bytebase / getComparatorType

Function getComparatorType

backend/api/v1/common.go:142–159  ·  view source on GitHub ↗
(op string)

Source from the content-addressed store, hash-verified

140}
141
142func 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.
162func normalizeFilter(filter string) (string, []string, error) {

Callers 1

parseExpressionFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected