| 1 | // Copyright 2018 Google LLC |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | // Package functions defines the standard builtin functions supported by the |
| 16 | // interpreter and as declared within the checker#StandardDeclarations. |
| 17 | package functions |
| 18 | |
| 19 | import fn "github.com/google/cel-go/common/functions" |
| 20 | |
| 21 | // Overload defines a named overload of a function, indicating an operand trait |
| 22 | // which must be present on the first argument to the overload as well as one |
| 23 | // of either a unary, binary, or function implementation. |
| 24 | // |
| 25 | // The majority of operators within the expression language are unary or binary |
| 26 | // and the specializations simplify the call contract for implementers of |
| 27 | // types with operator overloads. Any added complexity is assumed to be handled |
| 28 | // by the generic FunctionOp. |
| 29 | type Overload = fn.Overload |
| 30 | |
| 31 | // UnaryOp is a function that takes a single value and produces an output. |
| 32 | type UnaryOp = fn.UnaryOp |
| 33 | |
| 34 | // BinaryOp is a function that takes two values and produces an output. |
| 35 | type BinaryOp = fn.BinaryOp |
| 36 | |
| 37 | // FunctionOp is a function with accepts zero or more arguments and produces |
| 38 | // a value or error as a result. |
| 39 | type FunctionOp = fn.FunctionOp |