Documentation
¶
Index ¶
Constants ¶
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 ¶
NewDynamic creates a new Dynamic proxy.
func NewDynamicFromViper ¶
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 ¶
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.