Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RunCmd = &cobra.Command{ Use: "run", Short: "Run a test", Long: ``, Run: func(cmd *cobra.Command, args []string) { fileName, err := cmd.Flags().GetString("filename") if err != nil { log.Fatalf("Error declaring config file/path: %v", err) } Config, err = LoadConfig(fileName) if err != nil { log.Fatalf("Error parsing/unmarshalling the config file: %v", err) } testRun(Config) }, }
Functions ¶
This section is empty.
Types ¶
type AssertJsonPath ¶
type AssertXPath ¶
type AssertXPath struct {
XPath string `yaml:"xpath,omitempty"`
}
type Execution ¶
type Execution struct { Scenario string `yaml:"scenario"` Executor string `yaml:"executor"` Concurrency int `yaml:"concurrency"` HoldFor int `yaml:"holdfor"` RampUp int `yaml:"rampup"` Locations map[string]int `yaml:"locations"` LocationsWeighted bool `yaml:"locations-weighted"` Provisioning string `yaml:"provisioning"` }
func (*Execution) GetExecutionDetails ¶
type ExecutionConfig ¶
type ExecutionConfig struct { Execution []Execution `yaml:"execution"` Scenarios map[string]Scenarios `yaml:"scenarios"` }
Define the structs
var Config ExecutionConfig
func LoadConfig ¶
func LoadConfig(filename string) (ExecutionConfig, error)
func (*ExecutionConfig) GetRequestsForScenario ¶
func (c *ExecutionConfig) GetRequestsForScenario(name string) ([]Request, bool)
GetRequestsForScenario returns the requests associated with the given scenario name
func (*ExecutionConfig) GetScenarios ¶
func (c *ExecutionConfig) GetScenarios() []string
type ExtractJsonPath ¶
type ExtractJsonPath struct { }
type ExtractXPath ¶
type ExtractXPath struct { }
type Request ¶
type Request struct { URL string `yaml:"url"` Method string `yaml:"method"` Label string `yaml:"label"` Body string `yaml:"body,omitempty"` BodyFile string `yaml:"body-file,omitempty"` UploadFiles []UploadFile `yaml:"upload-files,omitempty"` Headers map[string]string `yaml:"headers,omitempty"` ThinkTime int `yaml:"think-time,omitempty"` Timeout int `yaml:"timeout,omitempty"` ContentEncoding string `yaml:"content-encoding,omitempty"` FollowRedirects bool `yaml:"follow-redirects,omitempty"` RandomSourceIP bool `yaml:"random-source-ip,omitempty"` Assert map[string][]string `yaml:"assert,omitempty"` AssertJsonPath []AssertJsonPath `yaml:"assert-jsonpath,omitempty"` AssertXPath []AssertXPath `yaml:"assert-xpath,omitempty"` ExtractJsonPath ExtractJsonPath `yaml:"extract-jsonpath,omitempty"` ExtractXPath ExtractXPath `yaml:"extract-xpath,omitempty"` }
type UploadFile ¶
Click to show internal directories.
Click to hide internal directories.