eval

package
v0.0.0-...-01651bc Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package eval provides expr-lang expression evaluation for deployment YAML files.

It supports two forms of substitution:

  • Simple variable expansion: ${VAR} and ${env.VAR}
  • Expression blocks: ${{ expr }} using the expr-lang engine

All environment variables are available as top-level identifiers (e.g. VERSION) and also under the "env" namespace (e.g. env.VERSION).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(expression string, env map[string]string) (any, error)

Eval evaluates a single expr-lang expression with the given env as variables.

func EvalBool

func EvalBool(expression string, env map[string]string) (bool, error)

EvalBool evaluates an expression that should return a boolean.

func Expand

func Expand(s string, env map[string]string) (string, error)

Expand processes a string, evaluating any ${{ expr }} blocks using expr-lang. The env map is available inside expressions as top-level variables. Regular ${VAR} / ${env.VAR} substitutions are also performed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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