Documentation ¶
Index ¶
- Constants
- type AddrDeadliner
- type AddrSpec
- type AdminUI
- type ClientHandler
- type Config
- type ConfigHolder
- type ConfigLoader
- type ErrorList
- type FileConfigLoader
- type InputConfigLoader
- type JsonHttpResponse
- type Listener
- type Proxy
- func (proxy *Proxy) AdminAddr() net.Addr
- func (proxy *Proxy) CallUplink(block func() (*resp.Msg, error)) (*resp.Msg, error)
- func (proxy *Proxy) GetConfig() *Config
- func (proxy *Proxy) GetInfo() *ProxyInfo
- func (proxy *Proxy) ListenAddr() net.Addr
- func (proxy *Proxy) ListenRawAddr() net.Addr
- func (proxy *Proxy) Pause() error
- func (proxy *Proxy) Reload() error
- func (proxy *Proxy) ReloadConfig() error
- func (proxy *Proxy) RequiresClientAuth() bool
- func (proxy *Proxy) Run()
- func (proxy *Proxy) SetState(st ProxyState)
- func (proxy *Proxy) Start()
- func (proxy *Proxy) State() ProxyState
- func (proxy *Proxy) Stop() error
- func (proxy *Proxy) TerminateRawConnections() error
- func (proxy *Proxy) Unpause() error
- type ProxyChannels
- type ProxyInfo
- type ProxyState
- type RawHandler
- type RawProxy
- type RawProxyCmd
- type RawProxyInfo
- type TestConfigHolder
- type TestConfigLoader
- type TestRequest
Constants ¶
View Source
const ( CmdPause = command(iota) CmdUnpause CmdReload CmdStop CmdTerminateRawConnections )
View Source
const ( ProxyStopped = ProxyState(iota) ProxyStarting ProxyRunning ProxyPausing ProxyPaused ProxyStopping )
View Source
const ( // MaxConnections: not enforced, used only to ensure enough // space in request/release channels to make it easy to // measure current state. // // TODO: enforce? MaxConnections = 1000 )
View Source
const (
RawCmdTerminateAll = RawProxyCmd(iota)
)
View Source
const (
SanitizedPass = "[removed]"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddrDeadliner ¶
type AddrSpec ¶
type AddrSpec struct { Addr string `json:"addr"` Pass string `json:"pass"` TLS bool `json:"tls"` Network string `json:"network"` CertFile string `json:"certfile"` KeyFile string `json:"keyfile"` CACertFile string `json:"cacertfile"` SkipVerify bool `json:"skipverify,omitempty"` }
func (*AddrSpec) GetTLSConfig ¶
func (*AddrSpec) SanitizedForPublication ¶
type AdminUI ¶
func NewAdminUI ¶
type ClientHandler ¶
type ClientHandler struct {
// contains filtered or unexported fields
}
func NewClientHandler ¶
func NewClientHandler(cliConn *resp.Conn, proxy *Proxy) *ClientHandler
func (*ClientHandler) Run ¶
func (ch *ClientHandler) Run()
type Config ¶
type Config struct { Uplink AddrSpec `json:"uplink"` Listen AddrSpec `json:"listen"` ListenRaw AddrSpec `json:"listen_raw"` Admin AddrSpec `json:"admin"` ReadTimeLimitMs int64 `json:"read_time_limit_ms"` LogMessages bool `json:"log_messages"` }
func (*Config) SanitizedForPublication ¶
func (*Config) ValidateSwitchTo ¶
type ConfigHolder ¶
type ConfigHolder interface { ReloadConfig() GetConfig() *Config }
type ConfigLoader ¶
type FileConfigLoader ¶
type FileConfigLoader struct {
// contains filtered or unexported fields
}
func NewFileConfigLoader ¶
func NewFileConfigLoader(name string) *FileConfigLoader
func (*FileConfigLoader) Load ¶
func (f *FileConfigLoader) Load() (*Config, error)
type InputConfigLoader ¶
type InputConfigLoader struct {
// contains filtered or unexported fields
}
func NewInputConfigLoader ¶
func NewInputConfigLoader(reader io.Reader) *InputConfigLoader
func (*InputConfigLoader) Load ¶
func (c *InputConfigLoader) Load() (*Config, error)
type JsonHttpResponse ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func NewProxy ¶
func NewProxy(cl ConfigLoader) (*Proxy, error)
func (*Proxy) CallUplink ¶
func (*Proxy) ListenAddr ¶
func (*Proxy) ListenRawAddr ¶
func (*Proxy) ReloadConfig ¶
func (*Proxy) RequiresClientAuth ¶
func (*Proxy) SetState ¶
func (proxy *Proxy) SetState(st ProxyState)
func (*Proxy) State ¶
func (proxy *Proxy) State() ProxyState
func (*Proxy) TerminateRawConnections ¶
type ProxyChannels ¶
type ProxyChannels struct {
// contains filtered or unexported fields
}
type ProxyInfo ¶
type ProxyInfo struct { ActiveRequests int `json:"active_requests"` WaitingRequests int `json:"waiting_requests"` State ProxyState `json:"state"` StateStr string `json:"state_str"` Config *Config `json:"config"` RawConnections int `json:"raw_connections"` }
func (*ProxyInfo) SanitizedForPublication ¶
type ProxyState ¶
type ProxyState int
func (ProxyState) IsAlive ¶
func (s ProxyState) IsAlive() bool
func (ProxyState) IsStartingOrAlive ¶
func (s ProxyState) IsStartingOrAlive() bool
func (ProxyState) String ¶
func (s ProxyState) String() string
type RawHandler ¶
type RawHandler struct {
// contains filtered or unexported fields
}
func NewRawHandler ¶
func NewRawHandler(conn net.Conn, proxy *Proxy) *RawHandler
func (*RawHandler) CliAddr ¶
func (r *RawHandler) CliAddr() net.Addr
func (*RawHandler) DialUplink ¶
func (r *RawHandler) DialUplink() net.Conn
func (*RawHandler) Run ¶
func (r *RawHandler) Run()
func (*RawHandler) Terminate ¶
func (r *RawHandler) Terminate()
type RawProxy ¶
func NewRawProxy ¶
func (*RawProxy) GetInfo ¶
func (r *RawProxy) GetInfo() *RawProxyInfo
func (*RawProxy) TerminateAll ¶
func (r *RawProxy) TerminateAll()
type RawProxyCmd ¶
type RawProxyCmd int
type RawProxyInfo ¶
type RawProxyInfo struct {
HandlerCnt int
}
type TestConfigHolder ¶
type TestConfigHolder struct { GetConfigCallCnt int ReloadConfigCallCnt int // contains filtered or unexported fields }
func (*TestConfigHolder) GetConfig ¶
func (ch *TestConfigHolder) GetConfig() *Config
func (*TestConfigHolder) ReloadConfig ¶
func (ch *TestConfigHolder) ReloadConfig()
type TestConfigLoader ¶
type TestConfigLoader struct {
// contains filtered or unexported fields
}
func NewTestConfigLoader ¶
func NewTestConfigLoader(uplinkAddr string) *TestConfigLoader
func (*TestConfigLoader) Load ¶
func (c *TestConfigLoader) Load() (*Config, error)
func (*TestConfigLoader) Replace ¶
func (c *TestConfigLoader) Replace(conf *Config)
type TestRequest ¶
type TestRequest struct {
// contains filtered or unexported fields
}
func NewTestRequest ¶
func NewTestRequest(proxy *Proxy, block func()) *TestRequest
func (*TestRequest) Do ¶
func (r *TestRequest) Do()
Click to show internal directories.
Click to hide internal directories.