Path: blob/dev/pkg/protocols/common/variables/doc.go
2073 views
package variables12// There are total 5 sources of variables3// 1. VariablesMap - Variables defined in the template (available at Request.options.Variables in protocols)4// 2. PayloadsMap - Payloads defined in the template (available at Request.generator in protocols)5// 3. OptionsMap - Variables passed using CLI Options (+ Env) (available at generators.BuildPayloadFromOptions)6// 4. DynamicMap - Variables Obtained by extracting data from templates (available at Request.ExecuteWithResults + merged with previous internalEvent)7// 5. ProtocolMap - Variables generated by Evaluation Request / Responses of xyz protocol (available in Request.Make)8// 6. ConstantsMap - Constants defined in the template (available at Request.options.Constants in protocols)910// As we can tell , all variables sources are not linear i.e why they need to re-evaluated11// consider example12// variables:13// - name: "username@{{Host}}"1415// Linear Sources (once obtained no need to re-evaluate)16// simply put they don't contain references to other variables17// 1. OptionsMap18// 2. DynamicMap19// 3. ProtocolMap2021// Non-Linear Sources (need to re-evaluate)22// 1. VariablesMap23// 2. PayloadsMap24// Every time Linear Sources are updated , Non-Linear Sources need to be re-evaluated2526// Constants (no need to re-evaluate, should contain only scalars)272829