Documentation
¶
Index ¶
- type Conn
- type ConsistentHashBalancer
- func (b *ConsistentHashBalancer) Close()
- func (b *ConsistentHashBalancer) HandleSubConnStateChange(sc balancer.SubConn, state connectivity.State)
- func (b *ConsistentHashBalancer) Pick(info balancer.PickInfo) (balancer.PickResult, error)
- func (b *ConsistentHashBalancer) UpdateState(newState resolver.State)
- type ConsistentHashBalancerBuilder
- type SimpleHashBalancer
- type SimpleHashBalancerBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHashBalancer ¶ added in v0.0.3
type ConsistentHashBalancer struct {
// contains filtered or unexported fields
}
ConsistentHashBalancer uses consistent hashing to distribute load among connected backends.
func (*ConsistentHashBalancer) Close ¶ added in v0.0.3
func (b *ConsistentHashBalancer) Close()
Close closes the balancer and cleans up resources.
func (*ConsistentHashBalancer) HandleSubConnStateChange ¶ added in v0.0.3
func (b *ConsistentHashBalancer) HandleSubConnStateChange(sc balancer.SubConn, state connectivity.State)
HandleSubConnStateChange updates the state of a SubConn.
func (*ConsistentHashBalancer) Pick ¶ added in v0.0.3
func (b *ConsistentHashBalancer) Pick(info balancer.PickInfo) (balancer.PickResult, error)
Pick selects a server connection using consistent hashing.
func (*ConsistentHashBalancer) UpdateState ¶ added in v0.0.3
func (b *ConsistentHashBalancer) UpdateState(newState resolver.State)
UpdateState syncs the balancer state with the latest information about backends.
type ConsistentHashBalancerBuilder ¶ added in v0.0.3
type ConsistentHashBalancerBuilder struct {
// contains filtered or unexported fields
}
ConsistentHashBalancerBuilder constructs ConsistentHashBalancer instances.
func (*ConsistentHashBalancerBuilder) Build ¶ added in v0.0.3
func (b *ConsistentHashBalancerBuilder) Build(info base.PickerBuildInfo) balancer.Picker
Build builds a new ConsistentHashBalancer with the provided PickerBuildInfo.
type SimpleHashBalancer ¶ added in v0.0.3
type SimpleHashBalancer struct {
// contains filtered or unexported fields
}
SimpleHashBalancer is a load balancer that makes decision based on a hash value.
func (*SimpleHashBalancer) Pick ¶ added in v0.0.3
func (b *SimpleHashBalancer) Pick(info balancer.PickInfo) (balancer.PickResult, error)
Pick selects a connection using a simple hash function.
type SimpleHashBalancerBuilder ¶ added in v0.0.3
type SimpleHashBalancerBuilder struct {
Filter loadbalance.Filter
}
func (*SimpleHashBalancerBuilder) Build ¶ added in v0.0.3
func (b *SimpleHashBalancerBuilder) Build(info base.PickerBuildInfo) balancer.Picker