proxy

package
v0.0.0-...-8bfe3b3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultPath  = "proxy"
	SyncInterval = 2 * time.Second

	PrivateURLScope  = "private"
	PublicURLScope   = "public"
	XClusterIDKey    = "X-Cluster-ID"
	XServiceTokenKey = "X-Service-Token"
)

Dynamic proxy service related constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path is the path the proxy is served at.
	Path string
	// ServiceTokenEndpointPrefixes are prefixes of the endpoints that should have a service token injected into requests.
	ServiceTokenEndpointPrefixes []string
	// ServiceUserClientConfig is an HTTP config that allows logging in as the service user.
	ServiceUserClientConfig *asfclient.HTTPConfig
}

Config configures the dynamic proxy service and middleware.

func ConfigFromViper

func ConfigFromViper() *Config

ConfigFromViper creates a Config from the global Viper configuration.

type Dynamic

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

Dynamic provides dynamic HTTP and WebSocket proxy capabilities.

func NewDynamic

func NewDynamic(es endpointStore, dbService services.Service, config *Config) *Dynamic

NewDynamic creates a new Dynamic proxy.

func NewDynamicFromViper

func NewDynamicFromViper(es endpointStore, dbService services.Service) *Dynamic

NewDynamicFromViper creates a Dynamic proxy from the global Viper configuration.

func (*Dynamic) ForceUpdate

func (p *Dynamic) ForceUpdate()

ForceUpdate requests an immediate update of endpoints and waits for its completion.

func (*Dynamic) RegisterGRPCAPI

func (p *Dynamic) RegisterGRPCAPI(r apiserver.GRPCRouter)

RegisterGRPCAPI does nothing.

func (*Dynamic) RegisterHTTPAPI

func (p *Dynamic) RegisterHTTPAPI(r apiserver.HTTPRouter)

RegisterHTTPAPI registers the proxy endpoint at the configured path.

func (*Dynamic) StartEndpointsSync

func (p *Dynamic) StartEndpointsSync()

StartEndpointsSync starts synchronization of proxy endpoints.

func (*Dynamic) StopEndpointsSync

func (p *Dynamic) StopEndpointsSync()

StopEndpointsSync stops synchronization of proxy endpoints.

type Static

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

Static provides statically configured endpoints that proxy requests.

func NewStaticByViper

func NewStaticByViper() (p Static, err error)

NewStaticByViper creates a Static proxy based on global Viper configuration.

func (Static) RegisterGRPCAPI

func (Static) RegisterGRPCAPI(r apiserver.GRPCRouter)

RegisterGRPCAPI does nothing.

func (Static) RegisterHTTPAPI

func (p Static) RegisterHTTPAPI(r apiserver.HTTPRouter)

RegisterHTTPAPI registers the proxy endpoints.

Jump to

Keyboard shortcuts

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