Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Duration *time.Duration
Connections *int
Timeout *time.Duration
Mode *string
OutputFile *string
Interval *time.Duration
Preallocate *int
CPUs *int
Method *string
Body *RawRequestBody
Headers *RequestHeaders
TrustAll *bool
Format *string
Plugin *string
Target *string
}
Config is a struct containing all of the parsed CLI flags and arguments
type GocannonPlugin ¶
type GocannonPlugin interface {
// function called on gocannon startup with a config passed to it
Startup(cfg Config)
// function called before each request is sent
BeforeRequest(cid int) (target string, method string, body RawRequestBody, headers RequestHeaders)
// function that returns the plugin's name
GetName() string
}
GocannonPlugin is an interface that has to be satisfied by a custom gocannnon plugin
type RawRequestBody ¶
type RawRequestBody []byte
func (*RawRequestBody) IsCumulative ¶
func (b *RawRequestBody) IsCumulative() bool
func (*RawRequestBody) Set ¶
func (b *RawRequestBody) Set(value string) error
func (*RawRequestBody) String ¶
func (b *RawRequestBody) String() string
type RequestHeader ¶
RequestHeader represents a single HTTP request header (a key: value pair)
type RequestHeaders ¶
type RequestHeaders []RequestHeader
RequestHeaders is a slice of request headers that will be added to the request
func (*RequestHeaders) IsCumulative ¶
func (r *RequestHeaders) IsCumulative() bool
func (*RequestHeaders) Set ¶
func (r *RequestHeaders) Set(value string) error
func (*RequestHeaders) String ¶
func (r *RequestHeaders) String() string
Click to show internal directories.
Click to hide internal directories.