task

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Task       Task
	StatusCode int
	Duration   time.Duration
	BytesRead  int64
	Error      error
}

Result holds the outcome of a driver execution.

type Selector

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

Selector picks tasks by weight using the Vose alias method for O(1) selection.

func NewSelector

func NewSelector(targets []config.TargetConfig) (*Selector, error)

NewSelector builds the alias table from the target list. Panics if targets is empty.

func (*Selector) Pick

func (s *Selector) Pick() Task

Pick selects a target with probability proportional to its weight.

type Task

type Task struct {
	URL    string
	Type   string // http | browser | dns | websocket
	Config config.TargetConfig
}

Task is a single unit of work dispatched to a driver.

Jump to

Keyboard shortcuts

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