variables

package
v3.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 14 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluation added in v3.10.0

type Evaluation struct {
	Values         map[string]interface{}
	TemplateValues map[string]interface{}
	InteractURLs   []string
}

Evaluation contains variable values and the subset produced from template variable text.

type Scope added in v3.10.0

type Scope struct {
	// contains filtered or unexported fields
}

Scope contains values used while evaluating template variables.

Data values are terminal values from runtime, options, constants, payloads, or protocol context. Template values are produced from the template variables section and may be re-rendered when later data becomes available.

func NewScope added in v3.10.0

func NewScope() *Scope

NewScope creates an empty variable evaluation scope.

func (*Scope) AddData added in v3.10.0

func (s *Scope) AddData(values ...map[string]interface{}) *Scope

AddData adds terminal data values to the scope.

func (*Scope) AddDataValue added in v3.10.0

func (s *Scope) AddDataValue(key string, value interface{}) *Scope

AddDataValue adds one terminal data value to the scope.

func (*Scope) AddTemplate added in v3.10.0

func (s *Scope) AddTemplate(values map[string]interface{}) *Scope

AddTemplate adds values produced from template variables.

func (*Scope) AddTemplateValue added in v3.10.0

func (s *Scope) AddTemplateValue(key string, value interface{}) *Scope

AddTemplateValue adds one value produced from template variables.

func (*Scope) Values added in v3.10.0

func (s *Scope) Values() map[string]interface{}

Values returns a plain value map for render evaluation.

type Variable

type Variable struct {
	// LazyEval is used to evaluate variables lazily if it using any expression
	// or global variables.
	LazyEval                        bool `yaml:"-" json:"-"`
	utils.InsertionOrderedStringMap `yaml:"-" json:"-"`
}

Variable is a key-value pair of strings that can be used throughout template.

func (*Variable) Evaluate

func (variables *Variable) Evaluate(values map[string]interface{}) map[string]interface{}

Evaluate returns a finished map of variables based on set values

func (*Variable) EvaluateScope added in v3.10.0

func (variables *Variable) EvaluateScope(scope *Scope) Evaluation

EvaluateScope returns evaluated variables and records which returned values were produced from template variable text.

func (*Variable) EvaluateWithInteractsh

func (variables *Variable) EvaluateWithInteractsh(values map[string]interface{}, interact *interactsh.Client) (map[string]interface{}, []string)

EvaluateWithInteractsh returns evaluation results of variables with interactsh

func (*Variable) EvaluateWithInteractshScope added in v3.10.0

func (variables *Variable) EvaluateWithInteractshScope(scope *Scope, interact render.URLSource) Evaluation

EvaluateWithInteractshScope returns evaluated variables, source-level Interactsh URLs, and the subset of values produced from template variable text.

func (*Variable) GetAll

func (variables *Variable) GetAll() map[string]interface{}

GetAll returns all variables as a map

func (Variable) JSONSchema added in v3.2.4

func (variables Variable) JSONSchema() *jsonschema.Schema

func (*Variable) UnmarshalJSON

func (variables *Variable) UnmarshalJSON(data []byte) error

func (*Variable) UnmarshalYAML

func (variables *Variable) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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