Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandMapFunc ¶
func ExpandMapFunc(values map[string]string, objName string, lookup, preprocess func(string) string) map[string]string
ExpandMapFunc expands JavaScript template literals in map values. It binds a dynamic object with the given name to the JS runtime, using lookup to resolve property accesses. Each value is optionally preprocessed with preprocess before expansion (pass nil to skip).
Types ¶
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator handles JavaScript expression evaluation in strings.
func NewEvaluator ¶
NewEvaluator creates a new Evaluator with the given tools.
type Expander ¶
type Expander struct {
// contains filtered or unexported fields
}
Expander expands JavaScript template literals in strings using environment variables.
func NewJsExpander ¶
func NewJsExpander(env environment.Provider) *Expander
NewJsExpander creates a new Expander with the given environment provider.
func (*Expander) Expand ¶
Expand expands JavaScript template literals using the provided values map. The values are bound as top-level variables in the JS runtime alongside the env object from the Expander's environment provider.
func (*Expander) ExpandCommands ¶
ExpandCommands expands JavaScript template literals in all command fields.