proxy

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponder

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

ErrorResponder is an implementation of proxy.ErrorResponder

func (ErrorResponder) Error

func (e ErrorResponder) Error(_ http.ResponseWriter, _ *http.Request, err error)

func (ErrorResponder) Object

func (e ErrorResponder) Object(statusCode int, obj runtime.Object)

type Handler

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

Handler is a struct that stores a round tripper for a given URL with transport configuration. It acts as the proxy for calls made to an aggregator which need to be served by a delegate api server.

func New

func New(url *url.URL, transportConfig *transport.Config) (*Handler, error)

New creates a new Handler

func (*Handler) ServeHTTP

func (p *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles http requests by proxying the request to Handler's URL via the Handler's roundTripper. It uses proxy.NewUpgradeAwareHandler to wrap the transport and serve the content from the proxied call.

Jump to

Keyboard shortcuts

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