hash

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoServer = errors.New("no server")

Functions

This section is empty.

Types

type DefaultRing

type DefaultRing struct {
	Ring
	// contains filtered or unexported fields
}

func NewDefaultRing

func NewDefaultRing(servers []boot.CanHash) *DefaultRing

func (*DefaultRing) AddServer

func (h *DefaultRing) AddServer(server boot.CanHash)

func (*DefaultRing) Get

func (h *DefaultRing) Get(key interface{}) (server boot.CanHash, err error)

func (*DefaultRing) Length

func (h *DefaultRing) Length() int

func (*DefaultRing) Range

func (h *DefaultRing) Range(handler func(index int, server boot.CanHash) (handled bool))

func (*DefaultRing) RemoveServer

func (h *DefaultRing) RemoveServer(server boot.CanHash)

func (*DefaultRing) StoreServers

func (h *DefaultRing) StoreServers(servers []boot.CanHash)

type Node

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

type NodeList

type NodeList []Node

func (NodeList) Len

func (n NodeList) Len() int

func (NodeList) Less

func (n NodeList) Less(i, j int) bool

func (NodeList) Swap

func (n NodeList) Swap(i, j int)

type Ring

type Ring interface {
	StoreServers(servers []boot.CanHash)
	Get(key interface{}) (server boot.CanHash, err error)
	AddServer(server boot.CanHash)
	RemoveServer(server boot.CanHash)
	Length() int
	Range(handler func(index int, server boot.CanHash) (handled bool))
}

Jump to

Keyboard shortcuts

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