Documentation
¶
Index ¶
- func ExtractVariableStorage(cfg *AmmoConfig) (*vs.SourceStorage, error)
- func ParseShootName(shoot string) (string, int, int, error)
- func SpreadNames(input []ScenarioConfig) (map[string]int, int)
- type AmmoConfig
- type AmmoHCL
- type AssertSizeHCL
- type CallConfig
- type CallHCL
- type CallPostprocessorHCL
- type CallPreprocessorHCL
- type RequestConfig
- type RequestHCL
- type RequestPostprocessorHCL
- type RequestPreprocessorHCL
- type ScenarioConfig
- type ScenarioHCL
- type SourceHCL
- type TemplaterHCL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractVariableStorage ¶
func ExtractVariableStorage(cfg *AmmoConfig) (*vs.SourceStorage, error)
func SpreadNames ¶
func SpreadNames(input []ScenarioConfig) (map[string]int, int)
Types ¶
type AmmoConfig ¶
type AmmoConfig struct { Locals map[string]any VariableSources []vs.VariableSource `config:"variable_sources"` Requests []RequestConfig Calls []CallConfig Scenarios []ScenarioConfig }
AmmoConfig is a config for dynamic converting from map[string]interface{}
func ConvertHCLToAmmo ¶
func ConvertHCLToAmmo(ammo AmmoHCL) (*AmmoConfig, error)
func DecodeMap ¶
func DecodeMap(bytes []byte) (*AmmoConfig, error)
func ParseAmmoConfig ¶
func ParseAmmoConfig(file io.Reader) (*AmmoConfig, error)
func ReadAmmoConfig ¶
func ReadAmmoConfig(fs afero.Fs, fileName string) (ammoCfg *AmmoConfig, err error)
type AmmoHCL ¶
type AmmoHCL struct { VariableSources []SourceHCL `hcl:"variable_source,block" config:"variable_sources" yaml:"variable_sources"` Requests []RequestHCL `hcl:"request,block"` Calls []CallHCL `hcl:"call,block"` Scenarios []ScenarioHCL `hcl:"scenario,block"` }
type AssertSizeHCL ¶
type CallConfig ¶
type CallConfig struct { Name string Tag string Call string Payload string Metadata map[string]string Preprocessors []grpcgun.Preprocessor Postprocessors []grpcgun.Postprocessor }
type CallHCL ¶
type CallHCL struct { Name string `hcl:"name,label"` Tag *string `hcl:"tag" yaml:"tag,omitempty"` Call string `hcl:"call"` Metadata *map[string]string `hcl:"metadata" yaml:"metadata,omitempty"` Payload string `hcl:"payload"` Preprocessor []CallPreprocessorHCL `hcl:"preprocessor,block" yaml:"preprocessors,omitempty"` Postprocessors []CallPostprocessorHCL `hcl:"postprocessor,block" yaml:"postprocessors,omitempty"` }
type CallPostprocessorHCL ¶
type CallPreprocessorHCL ¶
type RequestConfig ¶
type RequestConfig struct { Name string Method string Headers map[string]string Tag string Body *string URI string Preprocessor *preprocessor.Preprocessor Postprocessors []httpscenario.Postprocessor Templater httpscenario.Templater }
RequestConfig is a config for dynamic converting from map[string]interface{}
type RequestHCL ¶
type RequestHCL struct { Name string `hcl:"name,label"` Method string `hcl:"method"` URI string `hcl:"uri"` Headers map[string]string `hcl:"headers" yaml:"headers,omitempty"` Tag *string `hcl:"tag" yaml:"tag,omitempty"` //TODO: remove Body *string `hcl:"body" yaml:"body,omitempty"` Preprocessor *RequestPreprocessorHCL `hcl:"preprocessor,block" yaml:"preprocessor,omitempty"` Postprocessors []RequestPostprocessorHCL `hcl:"postprocessor,block" yaml:"postprocessors,omitempty"` Templater *TemplaterHCL `hcl:"templater,block" yaml:"templater,omitempty"` }
type RequestPostprocessorHCL ¶
type RequestPostprocessorHCL struct { Type string `hcl:"type,label"` Mapping *map[string]string `hcl:"mapping" yaml:"mapping,omitempty"` Headers *map[string]string `hcl:"headers" yaml:"headers,omitempty"` Body *[]string `hcl:"body" yaml:"body,omitempty"` StatusCode *int `hcl:"status_code" yaml:"status_code,omitempty"` Size *AssertSizeHCL `hcl:"size,block" yaml:"size,omitempty"` }
type RequestPreprocessorHCL ¶
type ScenarioConfig ¶
type ScenarioConfig struct { Name string Weight int64 MinWaitingTime int64 `config:"min_waiting_time"` Requests []string }
ScenarioConfig is a config for dynamic converting from map[string]interface{}
type ScenarioHCL ¶
type SourceHCL ¶
type SourceHCL struct { Name string `hcl:"name,label"` Type string `hcl:"type,label"` File *string `hcl:"file" yaml:"file,omitempty"` Fields *[]string `hcl:"fields" yaml:"fields,omitempty"` IgnoreFirstLine *bool `hcl:"ignore_first_line" yaml:"ignore_first_line,omitempty"` Delimiter *string `hcl:"delimiter" yaml:"delimiter,omitempty"` Variables *map[string]string `hcl:"variables" yaml:"variables,omitempty"` }
type TemplaterHCL ¶
type TemplaterHCL struct {
Type string `hcl:"type" yaml:"type"`
}
Click to show internal directories.
Click to hide internal directories.