-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This registers the newest cel Extensions. * Lists * Sets * Maths The docs are updated and the cel-eval tool has been updated to register the extensions.
- Loading branch information
1 parent
cebc554
commit 3ec839c
Showing
5 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,8 +59,10 @@ You can either explicitly convert the number, or add another double value e.g. | |
|
||
```yaml | ||
interceptors: | ||
- cel: | ||
overlays: | ||
- ref: | ||
name: cel | ||
params: | ||
- name: overlays: | ||
- key: count_plus_1 | ||
expression: "body.count + 1.0" | ||
- key: count_plus_2 | ||
|
@@ -85,10 +87,13 @@ The following example will generate an error with the JSON example. | |
|
||
```yaml | ||
interceptors: | ||
- cel: | ||
overlays: | ||
- key: bad_measure_times_3 | ||
expression: "body.measure * 3" | ||
- ref: | ||
name: cel | ||
params: | ||
- name: overlays: | ||
values: | ||
- key: bad_measure_times_3 | ||
expression: "body.measure * 3" | ||
``` | ||
**bad_measure_times_3** will fail with | ||
|
@@ -151,6 +156,14 @@ This would add an extensions key `filtered` with only one of the labels. | |
All the functionality from the cel-go project's [CEL extension](https://github.com/google/cel-go/tree/master/ext) is available in | ||
your CEL expressions. | ||
|
||
The following extensions are available: | ||
|
||
* [Strings](https://pkg.go.dev/github.com/google/[email protected]/ext#Strings). | ||
* [Encoders](https://pkg.go.dev/github.com/google/[email protected]/ext#Encoders) | ||
* [Sets](https://pkg.go.dev/github.com/google/[email protected]/ext#Sets) | ||
* [Lists](https://pkg.go.dev/github.com/google/[email protected]/ext#Lists) | ||
* [Math](https://pkg.go.dev/github.com/google/[email protected]/ext#Math) | ||
|
||
### cel-go Bytes | ||
|
||
The cel-go project function `base64.decode` returns a [CEL `Bytes`](https://github.com/google/cel-spec/blob/master/doc/langdef.md#string-and-bytes-values) value. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters