tracehttp

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const ComponentName = "net/http"

Variables

This section is empty.

Functions

func Handler added in v0.13.0

func Handler(tracer opentracing.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 opentracing.Tracer, client *http.Client, extended bool) *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 opentracing.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) OpentracingCode

func (w *StatusCodeTracker) OpentracingCode() uint16

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 opentracing.Tracer, roundTripper http.RoundTripper, extended bool) *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