hash

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HashFunction string `yaml:"hashFunction" json:"hashFunction"`
}

Config 一致性hash配置对象

func (*Config) SetDefault

func (c *Config) SetDefault()

SetDefault 设置一致性hash默认值

func (*Config) Verify

func (c *Config) Verify() error

Verify 检验一致性hash配置

type LoadBalancer

type LoadBalancer struct {
	*plugin.PluginBase
	// contains filtered or unexported fields
}

LoadBalancer hash负载均衡插件

func (*LoadBalancer) ChooseInstance

func (g *LoadBalancer) ChooseInstance(criteria *loadbalancer.Criteria,
	inputInstances model.ServiceInstances) (model.Instance, error)

ChooseInstance 获取单个服务实例

func (*LoadBalancer) Destroy

func (g *LoadBalancer) Destroy() error

Destroy 销毁插件,可用于释放资源

func (*LoadBalancer) Init

func (g *LoadBalancer) Init(ctx *plugin.InitContext) error

Init 初始化插件

func (*LoadBalancer) Name

func (g *LoadBalancer) Name() string

Name 插件名,一个类型下插件名唯一

func (*LoadBalancer) Type

func (g *LoadBalancer) Type() common.Type

Type 插件类型

Jump to

Keyboard shortcuts

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