validateOperator checks if the provided operator is valid. Parameters: - operator: The operator to validate. Returns an error if the operator is invalid.
(operator string)
| 1252 | // - operator: The operator to validate. |
| 1253 | // Returns an error if the operator is invalid. |
| 1254 | func (s *LedgerForge) validateOperator(operator string) error { |
| 1255 | validOperators := []string{"equals", "greater_than", "less_than", "contains"} |
| 1256 | if !contains(validOperators, operator) { |
| 1257 | return errors.New("invalid operator") |
| 1258 | } |
| 1259 | return nil |
| 1260 | } |
| 1261 | |
| 1262 | // validateField checks if the provided field is valid for a matching rule. |
| 1263 | // Parameters: |
no test coverage detected