expression

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package expression evaluates ${...} expressions against a context map. If a string is a single expression, the resolved value preserves its Go type. Mixed literal+expression strings are interpolated to a string result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsExpression

func ContainsExpression(s string) bool

ContainsExpression reports whether s includes any ${...} pattern.

func Evaluate

func Evaluate(s string, ctx map[string]any) (any, error)

Evaluate resolves all ${...} expressions in s against ctx. A string that is exactly one expression (e.g. "${count}") returns the native Go value. Mixed strings return a string with interpolated values.

func ExtractPaths

func ExtractPaths(s string) []string

ExtractPaths returns every dot-path referenced in ${...} expressions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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