scenario

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DurationSleep added in v0.7.1

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

DurationSleep is the implementation of the exact duration sleep feature

type ISleep added in v0.7.1

type ISleep interface {
	// contains filtered or unexported methods
}

ISleep is the interface for implementing different sleep strategies.

type RangeSleep added in v0.7.1

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

RangeSleep is the implementation of the range sleep feature

type ScenarioService

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

ScenarioService encapsulates proxy/scenario/requester information and runs the scenario.

func NewScenarioService

func NewScenarioService() *ScenarioService

NewScenarioService is the constructor of the ScenarioService.

func (*ScenarioService) Do

func (s *ScenarioService) Do(proxy *url.URL, startTime time.Time) (response *types.Response, err *types.RequestError)

Do executes the scenario for the given proxy. Returns "types.Response" filled by the requester of the given Proxy, injects the given startTime to the response Returns error only if types.Response.Err.Type is types.ErrorProxy or types.ErrorIntented

func (*ScenarioService) Done added in v0.7.7

func (s *ScenarioService) Done()

func (*ScenarioService) Init

func (s *ScenarioService) Init(ctx context.Context, scenario types.Scenario, proxies []*url.URL) (err error)

Init initializes the ScenarioService.clients with the given types.Scenario and proxies. Passes the given ctx to the underlying requestor so we are able to control the life of each request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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