httptrace

package
v5.0.0-preview.1+incom... Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 3 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPTrace

type HTTPTrace interface {
	SetPhase(message string)
	SendRequest(method, url string)
	// return a reader of the body content if the body is consumed; otherwise, return nil
	GotResponse(statusCode int, status string, header http.Header, body io.ReadCloser) io.Reader
	GotError(message string)
	AddComment(step, comment string)
}

type NopTracer

type NopTracer struct {
}

func (NopTracer) AddComment

func (t NopTracer) AddComment(step, message string)

func (NopTracer) GotError

func (t NopTracer) GotError(message string)

func (NopTracer) GotResponse

func (t NopTracer) GotResponse(statusCode int, status string, header http.Header, body io.ReadCloser) io.Reader

func (NopTracer) SendRequest

func (t NopTracer) SendRequest(method, url string)

func (NopTracer) SetPhase

func (t NopTracer) SetPhase(message string)

type TraceClient

type TraceClient struct {
	Trace  HTTPTrace
	Client *http.Client
}

func (TraceClient) Do

func (tc TraceClient) Do(req *http.Request) (*http.Response, error)

func (TraceClient) Get

func (tc TraceClient) Get(url string) (*http.Response, error)

func (TraceClient) Head

func (tc TraceClient) Head(url string) (*http.Response, error)

func (TraceClient) Post

func (tc TraceClient) Post(url, contentType string, body io.Reader) (*http.Response, error)

func (TraceClient) SetTimeout

func (tc TraceClient) SetTimeout(timeout time.Duration)

Jump to

Keyboard shortcuts

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