expressions

package
v3.2.7 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 8 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsUnresolvedVariables

func ContainsUnresolvedVariables(items ...string) error

ContainsUnresolvedVariables returns an error with variable names if the passed input contains unresolved {{<pattern-here>}} variables.

func ContainsVariablesWithIgnoreList

func ContainsVariablesWithIgnoreList(skipNames map[string]interface{}, items ...string) error

ContainsVariablesWithIgnoreList returns an error with variable names if the passed input contains unresolved {{<pattern-here>}} other than the ones listed in the ignore list

func ContainsVariablesWithNames

func ContainsVariablesWithNames(names map[string]interface{}, items ...string) error

ContainsVariablesWithNames returns an error with variable names if the passed input contains unresolved {{<pattern-here>}} variables within the provided list

func Eval

func Eval(expression string, values map[string]interface{}) (interface{}, error)

Eval compiles the given expression and evaluate it with the given values preserving the return type

func Evaluate

func Evaluate(data string, base map[string]interface{}) (string, error)

Evaluate checks if the match contains a dynamic variable, for each found one we will check if it's an expression and can be compiled, it will be evaluated and the results will be returned.

The provided keys from finalValues will be used as variable names for substitution inside the expression.

func EvaluateByte

func EvaluateByte(data []byte, base map[string]interface{}) ([]byte, error)

EvaluateByte checks if the match contains a dynamic variable, for each found one we will check if it's an expression and can be compiled, it will be evaluated and the results will be returned.

The provided keys from finalValues will be used as variable names for substitution inside the expression.

func FindExpressions

func FindExpressions(data, OpenMarker, CloseMarker string, base map[string]interface{}) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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