mirror of https://github.com/knative/client.git
* upgrade to latest dependencies bumping knative.dev/serving 2332731...4229a18: > 4229a18 upgrade to latest dependencies (# 13352) > 183bea1 Add log message when internal encryption is enabled (# 13351) > affc8df upgrade to latest dependencies (# 13348) > 79a4588 Use kebab-case in config for queue sidecar image key (# 13347) > f0d66ee Update net-istio nightly (# 13345) > 6791c23 Update net-certmanager nightly (# 13346) > 842e273 Update net-gateway-api nightly (# 13344) > bedf5e9 Update community files (# 13342) > 47907d0 Update net-certmanager nightly (# 13341) > bf0e590 Update net-kourier nightly (# 13340) > c18d504 Update community files (# 13339) > 8a11681 Update net-kourier nightly (# 13336) > 243fad9 Update net-istio nightly (# 13334) > 4ac8668 Update net-kourier nightly (# 13335) > ed3515c Fix: Raise the reconciliation timeout from 10 to 30s. (# 13323) > 6b1972b upgrade to latest dependencies (# 13330) > 2befffb Update net-istio nightly (# 13328) bumping knative.dev/hack d1317b0...92a65f1: > 92a65f1 don't quote vars referencing files (# 234) > b3c9790 Notarize Mac binaries (# 231) > 0198902 Format go code (# 226) > 7dff557 Update community files (# 233) > 6887217 Update community files (# 232) > 9b76387 output certificate as well (# 229) Signed-off-by: Knative Automation <automation@knative.team> * Update to latest Eventing Signed-off-by: Knative Automation <automation@knative.team> Co-authored-by: David Simansky <dsimansk@redhat.com> |
||
|---|---|---|
| .. | ||
| expression | ||
| function | ||
| gen | ||
| parser | ||
| runtime | ||
| utils | ||
| CESQLLexer.g4 | ||
| CESQLParser.g4 | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| expression.go | ||
| function.go | ||
| types.go | ||
README.md
CloudEvents Expression Language Go implementation
CloudEvents Expression Language implementation.
Note: this package is a work in progress, APIs might break in future releases.
User guide
To start using it:
import cesqlparser "github.com/cloudevents/sdk-go/sql/v2/parser"
// Parse the expression
expression, err := cesqlparser.Parse("subject = 'Hello world'")
// Res can be either int32, bool or string
res, err := expression.Evaluate(event)
Development guide
To regenerate the parser, make sure you have ANTLR4 installed and then run:
antlr4 -v 4.10.1 -Dlanguage=Go -package gen -o gen -visitor -no-listener CESQLParser.g4
Then you need to run this sed command as a workaround until this ANTLR issue is resolved. Without this, building for 32bit platforms will throw an int overflow error:
sed -i 's/(1<</(int64(1)<</g' gen/cesqlparser_parser.go