Documentation
¶
Overview ¶
wr is Weighted random
Index ¶
- func NewNode(host string, port, weight int, meta selector.Meta) selector.Node
- type Node
- type Selector
- func (s *Selector) AddNode(node selector.Node) (err error)
- func (s *Selector) AfterHandle(address string, err error)
- func (s *Selector) DeleteNode(host string, port int) (err error)
- func (s *Selector) GetNode(host string, port int) (node selector.Node, ok bool)
- func (s *Selector) GetNodes() (nodes []selector.Node, err error)
- func (s *Selector) Select() (node selector.Node, err error)
- func (s *Selector) ServiceName() string
- type SelectorOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) Statistics ¶
func (n *Node) Statistics() selector.Statistics
type Selector ¶
type Selector struct {
// contains filtered or unexported fields
}
func NewSelector ¶
func NewSelector(opts ...SelectorOption) *Selector
func (*Selector) AfterHandle ¶
func (*Selector) ServiceName ¶
type SelectorOption ¶
type SelectorOption func(*Selector)
func WithServiceName ¶
func WithServiceName(name string) SelectorOption
Click to show internal directories.
Click to hide internal directories.