proxy

package
v0.0.0-...-e123e45 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SvcProxyAnnotationPrefix defines the annotation prefix used by the proxy.
	SvcProxyAnnotationPrefix = "k8s-svc-proxy.local/"

	// SvcProxyAnnotationPath is the annotation used by a kubernetes service
	// to add a specific string to the list of paths handled by this proxy.
	SvcProxyAnnotationPath = SvcProxyAnnotationPrefix + "path"

	// SvcProxyAnnotationPort (optional) specifies the HTTP port to forward traffic to.
	SvcProxyAnnotationPort = SvcProxyAnnotationPrefix + "port"

	// SvcProxyAnnotationMap (optional) specifies a URL mapping by prefix.
	SvcProxyAnnotationMap = SvcProxyAnnotationPrefix + "map"

	// SvcProxyAnnotationDescription (optional) defines a human readable description for the service.
	SvcProxyAnnotationDescription = SvcProxyAnnotationPrefix + "description"

	// SvcProxyAnnotationEndpoint (optional) specifies that the endpoints of the service should be
	// exposed under the /endpoint path.
	SvcProxyAnnotationEndpoint = SvcProxyAnnotationPrefix + "endpoint-port"
)
View Source
const SvcProxyHTTPPath = "/k8s-svc-proxy/"

SvcProxyHTTPPath is the http request path served by the proxy itself.

Variables

This section is empty.

Functions

func ExpandVars

func ExpandVars(vars map[string]string, value string) string

ExpandVars performs variable expansion of variables in the form of ${VAR}.

func NewKubernetesServiceProxy

func NewKubernetesServiceProxy(mux http.Handler) http.Handler

NewKubernetesServiceProxy allocates an http proxy that demuxes URLs based on the paths learnt from k8s service annotations.

Types

type EndpointStatus

type EndpointStatus struct {
	Name     string
	Port     int
	Backends []*podEndpoint
}

EndpointStatus is the status information corresponding to service backends.

Jump to

Keyboard shortcuts

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