http

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: GPL-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 Client

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

Client adds http request timings as part of the http response

func NewClient

func NewClient() Client

NewClient creates a default timed client

func (Client) Do

func (c Client) Do(ctx context.Context, request spec.Request) (*Response, error)

Do executes a http request

type Response

type Response struct {
	*http.Response

	Body    []byte
	Timings Timings
}

Response a http response with added timing information

type Timings

type Timings struct {
	DNSLookup,
	TCPConnection,
	TLSHandshake,
	ServerProcessing,
	ContentTransfer time.Duration
}

Timings holds the timings data for a http request

type Tracer

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

Tracer stores http request timings

func (*Tracer) Done

func (t *Tracer) Done()

func (*Tracer) Timings

func (t *Tracer) Timings() Timings

Timings computes and returns the timings for a request

func (*Tracer) Tracer

func (t *Tracer) Tracer() *httptrace.ClientTrace

Tracer returns a new httptrace.ClientTrace

Jump to

Keyboard shortcuts

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