proxy

package
v0.0.0-...-0c52521 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DashboardContext

type DashboardContext struct {
	ReflectionDisabled bool
	Services           []*DashboardServiceInfo
	Servers            []*DashboardServerInfo
	UnknownServer      *DashboardServerInfo
}

type DashboardServerInfo

type DashboardServerInfo struct {
	Config   UpstreamConfig
	Provider string
	Services []*DashboardServiceInfo
}

type DashboardServiceInfo

type DashboardServiceInfo struct {
	Name    string
	Servers []*DashboardServerInfo
}

type Proxy

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

Proxy must be created using [NewProxy]

func NewServer

func NewServer(config ProxyConfig) *Proxy

func (*Proxy) DashboardContext

func (p *Proxy) DashboardContext() DashboardContext

DashboardContext creates the struct that is used as the template data for the dashboard.

func (*Proxy) DashboardHandler

func (p *Proxy) DashboardHandler(w http.ResponseWriter, r *http.Request)

DashboardHandler serves the dashboard index.html file.

func (*Proxy) ReplaceServers

func (p *Proxy) ReplaceServers(provider string, newConfigs []UpstreamConfig)

func (*Proxy) ServeHTTP

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

ServeHTTP implements the http.Handler interface. This method is the entrypoint for all requests into the proxy.

func (*Proxy) ServerReflectionInfo

ServerReflectionInfo implements grpc_reflection_v1.ServerReflectionServer.

type ProxyConfig

type ProxyConfig struct {
	// DisableReflection will not expose the reflection service
	DisableReflection bool `mapstructure:"disableReflection"`

	Logger *zap.Logger
}

type UpstreamConfig

type UpstreamConfig struct {
	Address            string `mapstructure:"address"`
	Plaintext          bool   `mapstructure:"plaintext"`
	InsecureSkipVerify bool   `mapstructure:"insecureSkipVerify"`
}

Jump to

Keyboard shortcuts

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