http

package
v0.0.0-...-6d13c91 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 14

Documentation

Index

Constants

View Source
const DefaultServiceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"

DefaultServiceAccountTokenPath missing godoc

View Source
const InternalAuthorizationHeader = "X-Authorization"

InternalAuthorizationHeader missing godoc

Variables

This section is empty.

Functions

func GetRequestWithCredentials

func GetRequestWithCredentials(ctx context.Context, client *http.Client, url, tnt string, auth *model.Auth) (*http.Response, error)

GetRequestWithCredentials executes a GET http request to the given url with the provided auth credentials

func GetRequestWithoutCredentials

func GetRequestWithoutCredentials(client *http.Client, url, tnt string) (*http.Response, error)

GetRequestWithoutCredentials executes a GET http request to the given url

func NewServiceAccountTokenTransport

func NewServiceAccountTokenTransport(roundTripper HTTPRoundTripper) *serviceAccountTokenTransport

NewServiceAccountTokenTransport constructs an serviceAccountTokenTransport

func NewServiceAccountTokenTransportWithHeader

func NewServiceAccountTokenTransportWithHeader(roundTripper HTTPRoundTripper, headerName string) *serviceAccountTokenTransport

NewServiceAccountTokenTransportWithHeader constructs an serviceAccountTokenTransport with configurable header name

func NewServiceAccountTokenTransportWithPath

func NewServiceAccountTokenTransportWithPath(roundTripper HTTPRoundTripper, path string) *serviceAccountTokenTransport

NewServiceAccountTokenTransportWithPath constructs an serviceAccountTokenTransport with a given path

func NewServiceAccountTokenTransportWithPathAndHeader

func NewServiceAccountTokenTransportWithPathAndHeader(roundTripper HTTPRoundTripper, path, headerName string) *serviceAccountTokenTransport

NewServiceAccountTokenTransportWithPathAndHeader constructs a serviceAccountTokenTransport with a given path and configurable header name

Types

type AuthorizationProvider

type AuthorizationProvider interface {
	Name() string
	Matches(ctx context.Context) bool
	GetAuthorization(ctx context.Context) (string, error)
}

AuthorizationProvider missing godoc

type CorrelationIDTransport

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

CorrelationIDTransport is a transport that attaches all correlation ID headers to the ongoing request context.

func NewCorrelationIDTransport

func NewCorrelationIDTransport(roundTripper HTTPRoundTripper) *CorrelationIDTransport

NewCorrelationIDTransport returns a transport that attaches all correlation ID headers to the ongoing request context.

func (*CorrelationIDTransport) Clone

Clone clones the underlying transport.

func (*CorrelationIDTransport) GetTransport

func (c *CorrelationIDTransport) GetTransport() *http.Transport

GetTransport returns the underlying transport.

func (*CorrelationIDTransport) RoundTrip

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

RoundTrip attaches a correlation ID header to the ongoing request context.

type ErrorHandlerTransport

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

ErrorHandlerTransport missing godoc

func NewErrorHandlerTransport

func NewErrorHandlerTransport(roundTripper HTTPRoundTripper) *ErrorHandlerTransport

NewErrorHandlerTransport missing godoc

func (*ErrorHandlerTransport) Clone

Clone clones the underlying transport.

func (*ErrorHandlerTransport) GetTransport

func (c *ErrorHandlerTransport) GetTransport() *http.Transport

GetTransport returns the underlying transport.

func (*ErrorHandlerTransport) RoundTrip

func (c *ErrorHandlerTransport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip missing godoc

type HTTPRoundTripper

type HTTPRoundTripper interface {
	RoundTrip(*http.Request) (*http.Response, error)
	Clone() HTTPRoundTripper
	GetTransport() *http.Transport
}

HTTPRoundTripper missing godoc

func NewHTTPTransportWrapper

func NewHTTPTransportWrapper(tr *http.Transport) HTTPRoundTripper

NewHTTPTransportWrapper wraps http transport

type SecuredTransport

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

SecuredTransport missing godoc

func NewSecuredTransport

func NewSecuredTransport(roundTripper HTTPRoundTripper, providers ...AuthorizationProvider) *SecuredTransport

NewSecuredTransport missing godoc

func (*SecuredTransport) Clone

Clone clones the underlying transport

func (*SecuredTransport) GetTransport

func (c *SecuredTransport) GetTransport() *http.Transport

GetTransport returns the underlying transport.

func (*SecuredTransport) RoundTrip

func (c *SecuredTransport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip missing godoc

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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