tracehttp

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler added in v0.13.0

func Handler(tracer trace.Tracer, options ...Option) func(next http.Handler) http.Handler

Types

type Client

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

func NewClient

func NewClient(tracer trace.Tracer, client *http.Client) *Client

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, uri string) (*http.Response, error)

func (*Client) Post

func (c *Client) Post(ctx context.Context, uri, contentType string, body io.Reader) (*http.Response, error)

func (*Client) PostForm

func (c *Client) PostForm(ctx context.Context, uri string, data url.Values) (*http.Response, error)

type Middleware

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

func NewMiddleware

func NewMiddleware(tracer trace.Tracer, options ...Option) *Middleware

func (*Middleware) Middleware

func (m *Middleware) Middleware(next http.Handler) http.Handler

type Option

type Option func(options *Options)

func WithFilterFunc

func WithFilterFunc(f func(r *http.Request) bool) Option

func WithNameFunc

func WithNameFunc(f func(r *http.Request) string) Option

type Options

type Options struct {
	NameFunc func(r *http.Request) string
	Filter   func(r *http.Request) bool
}

type StatusCodeTracker

type StatusCodeTracker struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewStatusCodeTracker

func NewStatusCodeTracker(w http.ResponseWriter) *StatusCodeTracker

func (*StatusCodeTracker) WriteHeader

func (w *StatusCodeTracker) WriteHeader(status int)

func (*StatusCodeTracker) Writer added in v0.13.1

Writer returns a wrapped version of the original ResponseWriter and only implements the same combination of additional interfaces as the original. This implementation is based on https://github.com/felixge/httpsnoop.

type Transport

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

func NewTransport

func NewTransport(tracer trace.Tracer, roundTripper http.RoundTripper) *Transport

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip implements the RoundTripper interface.

Jump to

Keyboard shortcuts

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