Documentation ¶
Index ¶
- Constants
- type DebugReporter
- type LVSWRRSelector
- func (ls *LVSWRRSelector) Add(url string, upstreamType UpstreamType, weight int32) (err error)
- func (ls *LVSWRRSelector) Get() *Upstream
- func (ls *LVSWRRSelector) ReportUpstreamStatus(upstream *Upstream, upstreamStatus upstreamStatus)
- func (ls *LVSWRRSelector) ReportWeights()
- func (ls *LVSWRRSelector) StartEvaluate()
- type NginxWRRSelector
- func (ws *NginxWRRSelector) Add(url string, upstreamType UpstreamType, weight int32) (err error)
- func (ws *NginxWRRSelector) Get() *Upstream
- func (ws *NginxWRRSelector) ReportUpstreamStatus(upstream *Upstream, upstreamStatus upstreamStatus)
- func (ws *NginxWRRSelector) ReportWeights()
- func (ws *NginxWRRSelector) StartEvaluate()
- type RandomSelector
- type Selector
- type Upstream
- type UpstreamType
Constants ¶
View Source
const ( // when query upstream timeout, usually upstream is unavailable for a long time. Timeout upstreamStatus = iota // when query upstream return 5xx response, upstream still alive, maybe just a lof of query for him. Error // when query upstream ok, means upstream is available. OK )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugReporter ¶
type DebugReporter interface {
// ReportWeights starts a goroutine to report all upstream weights, recommend interval is 15s
ReportWeights()
}
type LVSWRRSelector ¶
type LVSWRRSelector struct {
// contains filtered or unexported fields
}
func NewLVSWRRSelector ¶
func NewLVSWRRSelector(timeout time.Duration) *LVSWRRSelector
func (*LVSWRRSelector) Add ¶
func (ls *LVSWRRSelector) Add(url string, upstreamType UpstreamType, weight int32) (err error)
func (*LVSWRRSelector) Get ¶
func (ls *LVSWRRSelector) Get() *Upstream
func (*LVSWRRSelector) ReportUpstreamStatus ¶
func (ls *LVSWRRSelector) ReportUpstreamStatus(upstream *Upstream, upstreamStatus upstreamStatus)
func (*LVSWRRSelector) ReportWeights ¶
func (ls *LVSWRRSelector) ReportWeights()
func (*LVSWRRSelector) StartEvaluate ¶
func (ls *LVSWRRSelector) StartEvaluate()
type NginxWRRSelector ¶
type NginxWRRSelector struct {
// contains filtered or unexported fields
}
func NewNginxWRRSelector ¶
func NewNginxWRRSelector(timeout time.Duration) *NginxWRRSelector
func (*NginxWRRSelector) Add ¶
func (ws *NginxWRRSelector) Add(url string, upstreamType UpstreamType, weight int32) (err error)
func (*NginxWRRSelector) ReportUpstreamStatus ¶
func (ws *NginxWRRSelector) ReportUpstreamStatus(upstream *Upstream, upstreamStatus upstreamStatus)
func (*NginxWRRSelector) ReportWeights ¶
func (ws *NginxWRRSelector) ReportWeights()
func (*NginxWRRSelector) StartEvaluate ¶
func (ws *NginxWRRSelector) StartEvaluate()
type RandomSelector ¶
type RandomSelector struct {
// contains filtered or unexported fields
}
func NewRandomSelector ¶
func NewRandomSelector() *RandomSelector
func (*RandomSelector) Add ¶
func (rs *RandomSelector) Add(url string, upstreamType UpstreamType) (err error)
func (*RandomSelector) Get ¶
func (rs *RandomSelector) Get() *Upstream
func (*RandomSelector) ReportUpstreamStatus ¶
func (rs *RandomSelector) ReportUpstreamStatus(upstream *Upstream, upstreamStatus upstreamStatus)
func (*RandomSelector) StartEvaluate ¶
func (rs *RandomSelector) StartEvaluate()
type Upstream ¶
type Upstream struct { Type UpstreamType URL string RequestType string // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.