add relay proxy
This commit is contained in:
@ -76,12 +76,12 @@ func (g *NodeGroup) Next() *Node {
|
||||
return nil
|
||||
}
|
||||
|
||||
selector := g.selector
|
||||
if selector == nil {
|
||||
return g.nodes[0]
|
||||
s := g.selector
|
||||
if s == nil {
|
||||
s = DefaultSelector
|
||||
}
|
||||
|
||||
return selector.Select(g.nodes...)
|
||||
return s.Select(g.nodes...)
|
||||
}
|
||||
|
||||
type FailMarker struct {
|
||||
|
@ -14,6 +14,10 @@ const (
|
||||
DefaultFailTimeout = 30 * time.Second
|
||||
)
|
||||
|
||||
var (
|
||||
DefaultSelector = NewSelector(RoundRobinStrategy())
|
||||
)
|
||||
|
||||
type Selector interface {
|
||||
Select(nodes ...*Node) *Node
|
||||
}
|
||||
|
Reference in New Issue
Block a user