hash

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn added in v0.0.3

type Conn struct {
	SubConn balancer.SubConn
	Address resolver.Address
}

Conn represents a connection with its address.

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

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

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL