requester

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpRequester added in v0.5.0

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

func (*HttpRequester) Init added in v0.5.0

func (h *HttpRequester) Init(ctx context.Context, s types.ScenarioItem, proxyAddr *url.URL) (err error)

Init creates a client with the given scenarioItem. HttpRequester uses the same http.Client for all requests

func (*HttpRequester) Send added in v0.5.0

func (h *HttpRequester) Send() (res *types.ResponseItem)

type Requester

type Requester interface {
	Init(context.Context, types.ScenarioItem, *url.URL) error
	Send() *types.ResponseItem
}

Requester is the interface that abstracts different protocols' request sending implementations. Protocol field in the types.ScenarioItem determines which requester implementation to use.

func NewRequester

func NewRequester(s types.ScenarioItem) (requester Requester, err error)

NewRequester is the factory method of the Requester.

Jump to

Keyboard shortcuts

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