sharder

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShardTypeHash = iota + 1
	ShardTypeRange
)

Variables

This section is empty.

Functions

func Hash

func Hash(key []byte) (uint32, error)

Types

type ShardType

type ShardType int

type Sharder

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

func NewSharder

func NewSharder(cluster cluster.Cluster) *Sharder

func (*Sharder) CalculateShard

func (s *Sharder) CalculateShard(shardType ShardType, key []byte) (uint64, error)

func (*Sharder) CalculateShardWithShardIDs

func (s *Sharder) CalculateShardWithShardIDs(shardType ShardType, key []byte, shardIDs []uint64) (uint64, error)

func (*Sharder) Start

func (s *Sharder) Start() error

func (*Sharder) Stop

func (s *Sharder) Stop() error

Jump to

Keyboard shortcuts

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