ketama

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const Name = "ngrpc_balancer_ketama"

Variables

This section is empty.

Functions

func New

func New(key string, h func() hash.Hash32) balancer.Builder

New 创建一致性 Hash 负载均衡器

使用: grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, ketama.Name))

Types

type Picker added in v0.0.5

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

func (*Picker) Pick added in v0.0.5

func (this *Picker) Pick(info balancer.PickInfo) (balancer.PickResult, error)

type PickerBuilder added in v0.0.5

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

func (*PickerBuilder) Build added in v0.0.5

func (this *PickerBuilder) Build(info base.PickerBuildInfo) balancer.Picker

Jump to

Keyboard shortcuts

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