condition

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSyntax

func CheckSyntax(expr string) error

CheckSyntax parses a CEL expression for syntax errors without evaluating it. Used by ocarina validate to catch bad expressions before any MCP calls run.

func EvalBool

func EvalBool(expr string, vars map[string]string, output string) (bool, error)

EvalBool evaluates a CEL boolean expression against the current variable set. output is the step's text output; pass "" for when: (which runs before execution). vars is the current notes map (rondo vars + prior register: captures).

Variables are injected at the top level so authors write:

when: "deploy_status == 'ready'"
expect:
  rule: "output.contains('success') && count != ''"

func EvalString added in v0.5.0

func EvalString(expr string, vars map[string]string, output string) (string, error)

EvalString evaluates a CEL expression and returns its result rendered as a string. set: uses this to compute a variable without calling a tool. Values are injected as strings (like EvalBool), so this composes and slices strings; arithmetic on numeric-looking vars is not yet supported.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL