httpmiddleware

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TenantIDRoundTripper

type TenantIDRoundTripper struct {
	// TenantName is the name of the tenant to be added to the request header.
	TenantName string
	// Next is the next RoundTripper in the chain.
	Next http.RoundTripper
}

TenantIDRoundTripper is a custom implementation of http.RoundTripper. It adds a tenant name to the request header before passing it to the next RoundTripper.

func (*TenantIDRoundTripper) RoundTrip

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

RoundTrip adds the tenant name to the request header and then passes the request to the next RoundTripper. If TenantName is not set, it simply passes the request to the next RoundTripper. It returns the response from the next RoundTripper and any error encountered.

Jump to

Keyboard shortcuts

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