Documentation ¶
Index ¶
- Variables
- type Balancer
- type BalancerCluster
- type BalancerServer
- type ClusterBalancer
- func (m *ClusterBalancer) BalanceByChunk(prefix, chunkname string) (_ string, server *BalancerServer, e error)
- func (m *ClusterBalancer) BalanceRandom() (_ string, server *BalancerServer, e error)
- func (m *ClusterBalancer) GetClusterName() string
- func (m *ClusterBalancer) GetStats() io.Reader
- func (m *ClusterBalancer) ResetStats()
- func (m *ClusterBalancer) ResetUpstream()
- func (m *ClusterBalancer) UpdateServers(servers map[string]net.IP)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnparsableChunk = errors.New("could not get server because of invalid chunk name") )
View Source
var GetBalancerByString = map[string]BalancerCluster{ "cache-nodes": BalancerClusterNodes, "cache-cloud": BalancerClusterCloud, }
Functions ¶
This section is empty.
Types ¶
type BalancerCluster ¶
type BalancerCluster uint8
const ( BalancerClusterNodes BalancerCluster = iota BalancerClusterCloud )
type BalancerServer ¶
type ClusterBalancer ¶
func NewClusterBalancer ¶
func NewClusterBalancer(ctx context.Context, cluster BalancerCluster) *ClusterBalancer
func (*ClusterBalancer) BalanceByChunk ¶
func (m *ClusterBalancer) BalanceByChunk(prefix, chunkname string) (_ string, server *BalancerServer, e error)
func (*ClusterBalancer) BalanceRandom ¶
func (m *ClusterBalancer) BalanceRandom() (_ string, server *BalancerServer, e error)
func (*ClusterBalancer) GetClusterName ¶
func (m *ClusterBalancer) GetClusterName() string
func (*ClusterBalancer) GetStats ¶
func (m *ClusterBalancer) GetStats() io.Reader
func (*ClusterBalancer) ResetStats ¶
func (m *ClusterBalancer) ResetStats()
func (*ClusterBalancer) ResetUpstream ¶
func (m *ClusterBalancer) ResetUpstream()
func (*ClusterBalancer) UpdateServers ¶
func (m *ClusterBalancer) UpdateServers(servers map[string]net.IP)
Click to show internal directories.
Click to hide internal directories.