proxy

package
v0.28.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpHandler

type HttpHandler struct {
	Index          index.Index
	Mappings       HttpHandlerMappings
	DefaultHandler http.Handler
}

func (*HttpHandler) ServeHTTP

func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HttpHandlerMapping

type HttpHandlerMapping struct {
	Weight  int
	Path    string
	Handler http.Handler
}

httpHandlerMapping is used to route traffic to the correct backend server. Higher weight means that the mapping is more specific and should be matched first.

type HttpHandlerMappings

type HttpHandlerMappings []HttpHandlerMapping

func (HttpHandlerMappings) Sort

func (h HttpHandlerMappings) Sort()

Sort mappings by weight higher weight means that the mapping is more specific and should be matched first Example: /clusters/cluster1/ will be matched before /clusters/ .

type PathMapping

type PathMapping struct {
	Path              string `json:"path"`
	Backend           string `json:"backend"`
	BackendServerCA   string `json:"backend_server_ca"`
	ProxyClientCert   string `json:"proxy_client_cert"`
	ProxyClientKey    string `json:"proxy_client_key"`
	UserHeader        string `json:"user_header,omitempty"`
	GroupHeader       string `json:"group_header,omitempty"`
	ExtraHeaderPrefix string `json:"extra_header_prefix"`
}

PathMapping describes how to route traffic from a path to a backend server. Each Path is registered with the DefaultServeMux with a handler that delegates to the specified backend.

Jump to

Keyboard shortcuts

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