package
Version:
v0.3.3
Opens a new window with list of versions in this module.
Published: Dec 9, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func NewSW(maxFails int) *SW
func (w *SW) Add(item interface{}, weight int)
Add a weighted server.
func (w *SW) All() map[interface{}]int
All returns all items.
Next returns next selected server.
RemoveAll removes all weighted items.
Reset resets all current weights.
type SWItem interface {
Index() int
Item() interface{}
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.