Documentation ¶
Index ¶
- type Config
- type Forwarder
- func (f *Forwarder) AddHandler(h StatusHandler)
- func (f *Forwarder) Addr() string
- func (f *Forwarder) Dial(network, addr string) (c net.Conn, err error)
- func (f *Forwarder) Disable()
- func (f *Forwarder) Enable()
- func (f *Forwarder) Enabled() bool
- func (f *Forwarder) Failures() uint32
- func (f *Forwarder) IncFailures()
- func (f *Forwarder) Latency() int64
- func (f *Forwarder) MaxFailures() uint32
- func (f *Forwarder) Priority() uint32
- func (f *Forwarder) SetLatency(l int64)
- func (f *Forwarder) SetMaxFailures(l uint32)
- func (f *Forwarder) SetPriority(l uint32)
- type Proxy
- type StatusHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Strategy string CheckWebSite string CheckWebSitePath string CheckWebSiteLen int CheckInterval int CheckTimeout int CheckThreshold int MaxFailures int IntFace string }
Config is strategy config struct.
type Forwarder ¶ added in v0.9.3
Forwarder is a forwarder
func DirectForwarder ¶ added in v0.9.3
DirectForwarder returns a direct forwarder
func ForwarderFromURL ¶ added in v0.9.3
ForwarderFromURL parses `forward=` command value and returns a new forwarder
func (*Forwarder) AddHandler ¶ added in v0.9.3
func (f *Forwarder) AddHandler(h StatusHandler)
AddHandler adds a custom handler to handle the status change event
func (*Forwarder) IncFailures ¶ added in v0.9.3
func (f *Forwarder) IncFailures()
IncFailures increase the failuer count by 1
func (*Forwarder) MaxFailures ¶ added in v0.9.3
MaxFailures returns the maxFailures of forwarder
func (*Forwarder) SetLatency ¶ added in v0.9.3
SetLatency sets the latency of forwarder
func (*Forwarder) SetMaxFailures ¶ added in v0.9.3
SetMaxFailures sets the maxFailures of forwarder
func (*Forwarder) SetPriority ¶ added in v0.9.3
SetPriority sets the priority of forwarder
type Proxy ¶ added in v0.9.3
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is base proxy struct.
func (*Proxy) Check ¶ added in v0.9.3
func (p *Proxy) Check()
Check implements the Checker interface.
type StatusHandler ¶ added in v0.9.3
type StatusHandler func(*Forwarder)
StatusHandler function will be called when the forwarder's status changed
Click to show internal directories.
Click to hide internal directories.