dht

package
v0.0.0-...-25c693f Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RandomPartInstance = NewRandomPartitioner()
)

RandomPartInstance ...

Functions

This section is empty.

Types

type IPartitioner

type IPartitioner interface {
	DecorateKey(key string) string
	UndecorateKey(decoreateddKey string) string
	Compare(s1, s2 string) int
	GetToken(key string) string
}

IPartitioner ...

type OrderPreservingPartitioner

type OrderPreservingPartitioner struct{}

OrderPreservingPartitioner ...

func NewOPP

NewOPP ...

func (*OrderPreservingPartitioner) Compare

func (r *OrderPreservingPartitioner) Compare(s1, s2 string) int

Compare ...

func (*OrderPreservingPartitioner) DecorateKey

func (r *OrderPreservingPartitioner) DecorateKey(key string) string

DecorateKey ...

func (*OrderPreservingPartitioner) GetToken

func (r *OrderPreservingPartitioner) GetToken(key string) string

GetToken ...

func (*OrderPreservingPartitioner) UndecorateKey

func (r *OrderPreservingPartitioner) UndecorateKey(decoratedKey string) string

UndecorateKey ...

type RandomPartitioner

type RandomPartitioner struct {
}

RandomPartitioner ...

func NewRandomPartitioner

func NewRandomPartitioner() *RandomPartitioner

NewRandomPartitioner ...

func (*RandomPartitioner) Compare

func (r *RandomPartitioner) Compare(s1, s2 string) int

Compare ...

func (*RandomPartitioner) DecorateKey

func (r *RandomPartitioner) DecorateKey(key string) string

DecorateKey ...

func (*RandomPartitioner) GetDefaultToken

func (r *RandomPartitioner) GetDefaultToken() string

GetDefaultToken ...

func (*RandomPartitioner) GetToken

func (r *RandomPartitioner) GetToken(key string) string

GetToken ...

func (*RandomPartitioner) Hash

func (r *RandomPartitioner) Hash(key string) string

Hash ...

func (*RandomPartitioner) UndecorateKey

func (r *RandomPartitioner) UndecorateKey(decoratedKey string) string

UndecorateKey ...

type Range

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

Range is a representation of the range that a node is responsible for on the DHT ring.

Jump to

Keyboard shortcuts

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