Documentation ¶
Index ¶
Constants ¶
const ( FieldMethod = "method" FieldURL = "url" FieldHeader = "header" FieldBody = "body" FieldRequests = "requests" FieldConcurrency = "concurrency" FieldInterval = "interval" FieldRequestTimeout = "requestTimeout" FieldGlobalTimeout = "globalTimeout" FieldOut = "out" FieldSilent = "silent" FieldTemplate = "template" )
Variables ¶
var FieldsUsage = map[string]string{ FieldMethod: "HTTP request method", FieldURL: "HTTP request url", FieldHeader: "HTTP request header", FieldBody: "HTTP request body", FieldRequests: "Number of requests to run, use duration as exit condition if omitted", FieldConcurrency: "Number of connections to run concurrently", FieldInterval: "Minimum duration between two non concurrent requests", FieldRequestTimeout: "Timeout for each HTTP request", FieldGlobalTimeout: "Max duration of test", FieldOut: "Output destination (benchttp,json,stdout)", FieldSilent: "Silent mode (no write to stdout)", FieldTemplate: "Output template", }
FieldsUsage is a record of all available config fields and their usage.
Functions ¶
Types ¶
type Body ¶
Body represents a request body associated with a type. The type affects the way the content is processed. If Type == "file", Content is read as a filepath to be resolved. If Type == "raw", Content is attached as-is.
Note: only "raw" is supported at the moment.
type Global ¶
Global represents the global configuration of the runner. It must be validated using Global.Validate before usage.
func (Global) Override ¶
Override returns a new Config based on cfg with overridden values from c. Only fields specified in options are replaced. Accepted options are limited to existing Fields, other values are silently ignored.
type InvalidConfigError ¶ added in v1.0.0
type InvalidConfigError struct {
Errors []error
}
InvalidConfigError is the errors returned by Global.Validate when values are missing or invalid.
func (*InvalidConfigError) Error ¶ added in v1.0.0
func (e *InvalidConfigError) Error() string
Error returns the joined errors of InvalidConfigError as a string.
type Output ¶
type Output struct { Out []OutputStrategy Silent bool Template string }
Output contains options relative to the output.
func (Output) HasStrategy ¶ added in v1.0.0
func (o Output) HasStrategy(s OutputStrategy) bool
type OutputStrategy ¶
type OutputStrategy string
const ( OutputBenchttp OutputStrategy = "benchttp" OutputJSON OutputStrategy = "json" OutputStdout OutputStrategy = "stdout" )