You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
392 B
23 lines
392 B
package selector |
|
|
|
import ( |
|
"context" |
|
"time" |
|
) |
|
|
|
type Balancer interface { |
|
Pick(ctx context.Context, nodes []WeightedNode) (WeightedNode, DoneFunc, error) |
|
} |
|
type BalancerBuilder interface { |
|
Builder() Balancer |
|
} |
|
type WeightedNode interface { |
|
Node |
|
Raw() Node |
|
Weight() float64 |
|
Pick() DoneFunc |
|
PickElapsed() time.Duration |
|
} |
|
type WeightedNodeBuilder interface { |
|
Build(Node) WeightedNode |
|
}
|
|
|