consistenthash

package
v0.0.0-...-e044eaa Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

package consistenthash allows nodes in the cluster to fetch cache from other nodes. Nodes are arranged in a hash ring and kvs are allocated to them accordingly. If the node we are communicating doesn't have the kv we are querying, it automatically fecthes the data from other nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash func(data []byte) uint32

type Map

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

func New

func New(replicas int, fn Hash) *Map

func (*Map) Add

func (m *Map) Add(keys ...string)

func (*Map) Get

func (m *Map) Get(key string) string

Jump to

Keyboard shortcuts

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