Documentation ¶
Index ¶
- Constants
- func GetRequestWithCredentials(ctx context.Context, client *http.Client, url, tnt string, auth *model.Auth) (*http.Response, error)
- func GetRequestWithoutCredentials(client *http.Client, url, tnt string) (*http.Response, error)
- func NewServiceAccountTokenTransport(roundTripper HTTPRoundTripper) *serviceAccountTokenTransport
- func NewServiceAccountTokenTransportWithHeader(roundTripper HTTPRoundTripper, headerName string) *serviceAccountTokenTransport
- func NewServiceAccountTokenTransportWithPath(roundTripper HTTPRoundTripper, path string) *serviceAccountTokenTransport
- func NewServiceAccountTokenTransportWithPathAndHeader(roundTripper HTTPRoundTripper, path, headerName string) *serviceAccountTokenTransport
- type AuthorizationProvider
- type CorrelationIDTransport
- type ErrorHandlerTransport
- type HTTPRoundTripper
- type SecuredTransport
Constants ¶
const DefaultServiceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"
DefaultServiceAccountTokenPath missing godoc
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 ¶
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 ¶
func (c *CorrelationIDTransport) Clone() HTTPRoundTripper
Clone clones the underlying transport.
func (*CorrelationIDTransport) GetTransport ¶
func (c *CorrelationIDTransport) GetTransport() *http.Transport
GetTransport returns the underlying transport.
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 ¶
func (c *ErrorHandlerTransport) Clone() HTTPRoundTripper
Clone clones the underlying transport.
func (*ErrorHandlerTransport) GetTransport ¶
func (c *ErrorHandlerTransport) GetTransport() *http.Transport
GetTransport returns the underlying transport.
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 ¶
func (c *SecuredTransport) Clone() HTTPRoundTripper
Clone clones the underlying transport
func (*SecuredTransport) GetTransport ¶
func (c *SecuredTransport) GetTransport() *http.Transport
GetTransport returns the underlying transport.