chash

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashingBalancer

type HashingBalancer struct {
	// contains filtered or unexported fields
}

HashingBalancer implements a consistent hashing balancer with virtual nodes.

func NewBalancer

func NewBalancer(proxies []proxy.Proxy, hashon string) *HashingBalancer

NewBalancer creates a new HashingBalancer instance. It initializes the hash ring with virtual nodes for each proxy.

func (*HashingBalancer) Proxies

func (b *HashingBalancer) Proxies() []proxy.Proxy

Proxies returns the list of proxies managed by the balancer.

func (*HashingBalancer) Select

Select picks a proxy from the hash ring based on a hashed value from the request. If the selected proxy is unavailable, it moves clockwise along the ring to find the next available one.

Jump to

Keyboard shortcuts

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