hashring

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrUpdateHashRing

func AddOrUpdateHashRing(key string, c *consistent.Consistent)

AddOrUpdateHashRing adds or updates a hash ring in cache

func DeleteHashRing

func DeleteHashRing(key string)

DeleteHashRing deletes a hash ring from cache

func GetHashRing

func GetHashRing(key string) (*consistent.Consistent, bool)

GetHashRing returns a hash ring from cache

func NewServiceInstanceHashRing

func NewServiceInstanceHashRing(instances []ServiceInstance) *consistent.Consistent

func RangeHashRing

func RangeHashRing(fn func(key, value interface{}) bool)

RangeHashRing ranges all hash rings

func SplitKey

func SplitKey(key string) (namespace, name, instanceName string, err error)

Types

type ServiceInstance

type ServiceInstance struct {
	Namespace    string
	Name         string
	InstanceName string
}

ServiceInstance is the implementation of the consistent.Member interface

func (ServiceInstance) String

func (si ServiceInstance) String() string

String gets service instance key

Jump to

Keyboard shortcuts

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