hash

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HashKeyIdx    = "idx"
	HashKeyExi    = "exi"
	HashKeyVarIdx = "%idx"
	ShardKeyVarDb = "%db"
	ShardKeyVarMm = "%mm"
)

Functions

This section is empty.

Types

type ConsistentHash

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

func NewConsistentHash

func NewConsistentHash(nodeTotal int, hashKey string) *ConsistentHash

func (*ConsistentHash) Get

func (ch *ConsistentHash) Get(key string) int

type Hash

type Hash interface {
	Get(key string) int
}

type Shard added in v0.4.0

type Shard interface {
	GetKey(db string, mm []byte) string
}

type ShardTpl added in v0.4.0

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

func NewShardTpl added in v0.4.0

func NewShardTpl(tpl string) *ShardTpl

func (*ShardTpl) GetKey added in v0.4.0

func (st *ShardTpl) GetKey(db string, mm []byte) string

Jump to

Keyboard shortcuts

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