You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change
I'm looking at whether or not CEL could be used as a DSL for an existing gRPC based query API. For a query API, we may need to operate on a list of objects and perform various operations. Some macros like filter, exists, and map already exist for some use-cases, and I would like to see if we could add additional functions that operate on lists.
Example
myList.slice(start, end) could slice a list, much like in Go or Python via: mylist[start:end].
myList.first(n) could take the first elements from a list.
myList.last(n) could take the last elements from a list.
Any many more could be considered, but at the moment, these 3 are the first ones I'm thinking about.
Alternatives considered
This could be handled outside of CEL, but being able to manipulate lists would be very useful for using CEL in a query language.
Change
I'm looking at whether or not CEL could be used as a DSL for an existing gRPC based query API. For a query API, we may need to operate on a list of objects and perform various operations. Some macros like
filter
,exists
, andmap
already exist for some use-cases, and I would like to see if we could add additional functions that operate on lists.Example
myList.slice(start, end)
could slice a list, much like in Go or Python via:mylist[start:end]
.myList.first(n)
could take the first elements from a list.myList.last(n)
could take the last elements from a list.Any many more could be considered, but at the moment, these 3 are the first ones I'm thinking about.
Alternatives considered
This could be handled outside of CEL, but being able to manipulate lists would be very useful for using CEL in a query language.
I wrote a quick MVP of
list.slice
here: master...chancez:cel-go:pr/chancez/slice_functionThe text was updated successfully, but these errors were encountered: