Documentation ¶
Index ¶
- type HttpRequester
- func (h *HttpRequester) Done()
- func (h *HttpRequester) Init(ctx context.Context, s types.ScenarioStep, proxyAddr *url.URL, debug bool, ...) (err error)
- func (h *HttpRequester) Send(client *http.Client, envs map[string]interface{}) (res *types.ScenarioStepResult)
- func (h *HttpRequester) Type() string
- type HttpRequesterI
- type Requester
- type SectionReadCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpRequester ¶
type HttpRequester struct {
// contains filtered or unexported fields
}
func (*HttpRequester) Done ¶
func (h *HttpRequester) Done()
func (*HttpRequester) Init ¶
func (h *HttpRequester) Init(ctx context.Context, s types.ScenarioStep, proxyAddr *url.URL, debug bool, ei *injection.EnvironmentInjector) (err error)
Init creates a client with the given scenarioItem. HttpRequester uses the same http.Client for all requests
func (*HttpRequester) Send ¶
func (h *HttpRequester) Send(client *http.Client, envs map[string]interface{}) (res *types.ScenarioStepResult)
func (*HttpRequester) Type ¶
func (h *HttpRequester) Type() string
type HttpRequesterI ¶
type HttpRequesterI interface { Init(ctx context.Context, ss types.ScenarioStep, url *url.URL, debug bool, ei *injection.EnvironmentInjector) error Send(client *http.Client, envs map[string]interface{}) *types.ScenarioStepResult // should use its own client if client is nil }
type Requester ¶
type Requester interface { Type() string Done() }
Requester is the interface that abstracts different protocols' request sending implementations. Protocol field in the types.ScenarioStep determines which requester implementation to use.
func NewRequester ¶
func NewRequester(s types.ScenarioStep) (requester Requester, err error)
NewRequester is the factory method of the Requester.
type SectionReadCloser ¶
type SectionReadCloser struct {
*io.SectionReader
}
func (*SectionReadCloser) Close ¶
func (s *SectionReadCloser) Close() error
Click to show internal directories.
Click to hide internal directories.