httptransport

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package http provides custom http transport implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggedTransport

type LoggedTransport struct{}

LoggedTransport adds request slog logging.

Responses with status code below 400 are logged with INFO level. Responses with status code of 400 or higher are logged with WARNING level. When DEBUG logging is enabled, will also log details of request and response.

func (LoggedTransport) RoundTrip

func (r LoggedTransport) RoundTrip(req *http.Request) (*http.Response, error)

type LoggedTransportWithRetries

type LoggedTransportWithRetries struct {
	MaxRetries         int
	StatusCodesToRetry []int
	DelayMilliseconds  int
}

LoggedTransportWithRetries adds request logging and automatic retrying for common HTTP errors.

func (LoggedTransportWithRetries) RoundTrip

func (t LoggedTransportWithRetries) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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