attacker

package
v0.0.0-...-9f78717 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVFeeder

type CSVFeeder struct {
	// contains filtered or unexported fields
}

CSVFeeder reads data from a CSV file and cycles through records

func NewCSVFeeder

func NewCSVFeeder(path string) (*CSVFeeder, error)

NewCSVFeeder creates a new CSV feeder

func (*CSVFeeder) Next

func (f *CSVFeeder) Next() map[string]string

Next returns the next record in the sequence, looping back to start if needed

type CompiledTemplate

type CompiledTemplate struct {
	// contains filtered or unexported fields
}

CompiledTemplate is a pre-parsed template ready for fast per-request execution. Parsing happens once at config load time; only substitution runs per request.

func CompileTemplate

func CompileTemplate(input string) *CompiledTemplate

CompileTemplate parses a template string into a CompiledTemplate. Must be called once per template string (URL, body, header value, variable value).

func (*CompiledTemplate) Execute

func (ct *CompiledTemplate) Execute(vp *VariableProcessor, session map[string]string) string

Execute renders the compiled template using the given session map and variable processor. Called on every request — designed to minimise allocations.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine implements the load testing logic

func NewEngine

func NewEngine() *Engine

func (*Engine) Attack

func (e *Engine) Attack(ctx context.Context, cfg models.Config, results chan<- models.Result)

Attack starts the load test

func (*Engine) PreflightCheck

func (e *Engine) PreflightCheck(url string, timeout time.Duration) error

PreflightCheck verifies that the target is reachable before starting the load test

type Feeder

type Feeder interface {
	Next() map[string]string
}

Feeder provides a stream of data records

type RetryConfig

type RetryConfig struct {
	MaxRetries int
	RetryDelay time.Duration
}

RetryConfig holds retry settings

func DefaultRetryConfig

func DefaultRetryConfig() RetryConfig

DefaultRetryConfig returns reasonable defaults for retries

type VariableProcessor

type VariableProcessor struct {
	// contains filtered or unexported fields
}

VariableProcessor handles the replacement of {{var}} in strings

func NewVariableProcessor

func NewVariableProcessor() *VariableProcessor

NewVariableProcessor creates a new processor with built-in functions

func (*VariableProcessor) Process

func (vp *VariableProcessor) Process(input string, session map[string]string) string

Process replaces placeholders in the input string using the session map and dynamic generators. It prioritizes session variables over dynamic ones.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL