khttpclient

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interceptor added in v0.3.5

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

func NewInterceptor added in v0.3.5

func NewInterceptor(core http.RoundTripper) *Interceptor

NewInterceptor constructs and returns the pointer to Interceptor. Interceptor is used to intercept every http client calls and store their responses into keploy context.

func (Interceptor) RoundTrip added in v0.3.5

func (i Interceptor) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip is the custom method which is called before making http client calls to capture or replay the outputs of external http service.

func (*Interceptor) SetContext added in v0.3.5

func (i *Interceptor) SetContext(requestContext context.Context)

SetContext is used to store the keploy context from request context into the Interceptor kctx field.

type ReadCloser

type ReadCloser struct {
	*bytes.Reader
	Body io.ReadCloser
}

ReadCloser is used so that gob could encode-decode http.Response.

func (ReadCloser) Close

func (rc ReadCloser) Close() error

func (*ReadCloser) MarshalBinary

func (rc *ReadCloser) MarshalBinary() ([]byte, error)

func (*ReadCloser) UnmarshalBinary

func (rc *ReadCloser) UnmarshalBinary(b []byte) error

Jump to

Keyboard shortcuts

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