loggingtransport

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(upstream http.RoundTripper, logger logger.Logger, level logging.Level) http.RoundTripper

New wraps an upstream client and logs all requests made.

func NewWithFilter added in v0.3.0

func NewWithFilter(upstream http.RoundTripper, logger logger.Logger, filter logging.Filter) http.RoundTripper

NewWithFilter wraps an upstream client and logs requests made according to the filter.

func Wrap added in v0.0.6

func Wrap(client *http.Client, logger logger.Logger, level logging.Level) *http.Client

Wrap a client and logs all requests made.

func WrapWithFilter added in v0.3.0

func WrapWithFilter(client *http.Client, logger logger.Logger, filter logging.Filter) *http.Client

WrapWithFilter wraps a client and logs requests made according to the filter.

Types

type LoggingTransport

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

LoggingTransport is a http.RoundTripper with a pluggable logger.

func (*LoggingTransport) RoundTrip

func (lt *LoggingTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper.

Jump to

Keyboard shortcuts

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