network

package
v1.60.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostSplitTransport added in v1.51.2

type HostSplitTransport struct {
	Host    string
	Matched http.RoundTripper
	Base    http.RoundTripper
}

HostSplitTransport sends requests addressed to Host (as host[:port]) through Matched and everything else through Base.

It exists because the HAProxy setup relaxes TLS verification: the internal address does not match the certificate. That concession is for requests rerouted to HAProxy only; any other host must still be verified.

func (*HostSplitTransport) RoundTrip added in v1.51.2

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

RoundTrip implements the RoundTripper interface.

type LoggingRoundTripper

type LoggingRoundTripper struct {
	Base http.RoundTripper
	Log  *slog.Logger
}

LoggingRoundTripper is an http.RoundTripper that logs requests and responses

func NewLoggingRoundTripper

func NewLoggingRoundTripper(logger *slog.Logger, base http.RoundTripper) *LoggingRoundTripper

NewLoggingRoundTripper creates a new LoggingRoundTripper with the given logger

func (*LoggingRoundTripper) RoundTrip

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

RoundTrip implements the RoundTripper interface

type PresignedSplitTransport deprecated

type PresignedSplitTransport struct {
	Base      http.RoundTripper
	Presigned http.RoundTripper
}

PresignedSplitTransport sends pre-signed storage requests through Presigned and everything else through Base.

Deprecated: it keeps verification for storage only, so a relaxed Base also reaches every other host unverified. Use HostSplitTransport.

func (*PresignedSplitTransport) RoundTrip

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

RoundTrip implements the RoundTripper interface.

Jump to

Keyboard shortcuts

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