MCPcopy Create free account
hub / github.com/cel-expr/cel-go / exercise3

Function exercise3

codelab/codelab.go:81–85  ·  view source on GitHub ↗

exercise3 demonstrates how CEL's commutative logical operators work. Construct an expression which checks whether the `request.auth.claims.group` value is equal to `admin` or the `request.auth.principal` is `user:me@acme.co` and the `request.time` is during work hours (9:00 - 17:00) Evaluate the e

()

Source from the content-addressed store, hash-verified

79// sets the appropriate principal and occurs at 12:00 hours. Then evaluate the
80// request a second time at midnight. Observe the difference in output.
81func exercise3() {
82 fmt.Println("=== Exercise 3: Logical AND/OR ===")
83
84 fmt.Println()
85}
86
87// exercise4 demonstrates how to extend CEL with custom functions.
88//

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected