http

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromRequest

func FromRequest(r *http.Request) logevent.Logger

FromRequest is a helper for extracting the logger from an *http.Request.

func NewMiddleware

func NewMiddleware(logger logevent.Logger) func(http.Handler) http.Handler

NewMiddleware generates an HTTP middleware with the given options set.

func NewTransport added in v1.4.0

func NewTransport(logger logevent.Logger) func(http.RoundTripper) http.RoundTripper

NewTransport wraps a `transport.Decorator` in a new one that injects a `logevent.Logger` into the context.

Types

type Middleware

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

Middleware wraps an http.Handler and injects a logevent.Logger in to the context.

func (*Middleware) ServeHTTP

func (m *Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Transport added in v1.4.0

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

Transport injects a `logevent.Logger` into the request context during its `http.RoundTrip`.

func (*Transport) RoundTrip added in v1.4.0

func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip injects a `logevent.Logger` into the current request context.

Jump to

Keyboard shortcuts

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