httputil

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package httputil contains functions that act as middleware for api interactions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggingRoundTripper

type LoggingRoundTripper struct {
	Proxied http.RoundTripper
	Logger  logging.Logger
}

LoggingRoundTripper implements http.RoundTripper. When set as Transport of http.Client, it executes HTTP requests with logging.

func (LoggingRoundTripper) RoundTrip

func (c LoggingRoundTripper) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip logs the http request and response in debug mode for all errors, where status code >= 400

Jump to

Keyboard shortcuts

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