mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-04 16:37:12 -05:00
fa0cf6db26
Some changes will be necessary to integrate it into V2Ray
23 lines
836 B
Go
23 lines
836 B
Go
package routing
|
|
|
|
import "time"
|
|
|
|
// BalancingStrategy is the interface for balancing strategies
|
|
type BalancingStrategy interface {
|
|
// Pick pick one outbound from candidates. Unlike the SelectAndPick(),
|
|
// it skips the select procedure (select all & pick one).
|
|
Pick(candidates []string) string
|
|
// SelectAndPick selects qualified nodes from candidates then pick one.
|
|
SelectAndPick(candidates []string) string
|
|
// GetInformation gets information of the strategy
|
|
GetInformation(tags []string) *StrategyInfo
|
|
}
|
|
|
|
// BalancingOverrider is the interface of those who can override
|
|
// the selecting of its balancers
|
|
type BalancingOverrider interface {
|
|
// OverrideSelecting overrides the selects of specified balancer, for 'validity'
|
|
// duration of time.
|
|
OverrideSelecting(balancer string, selects []string, validity time.Duration) error
|
|
}
|