valkey

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SlotCount

func SlotCount(slotRanges []*ClusterSlotRange) int

func SlotCounts

func SlotCounts(numShards int) []int

func TcpCheck added in v0.0.19

func TcpCheck(host, port string) bool

Types

type ClusterNode

type ClusterNode struct {
	Pod          string
	IP           string
	Hostname     string
	ID           string
	MasterNodeID string
	Flags        []string
	SlotRanges   []*ClusterSlotRange
}

func ParseClusterNode

func ParseClusterNode(clusterNodesTxt string) (*ClusterNode, error)

func ParseClusterNodes

func ParseClusterNodes(clusterNodesTxt string) ([]*ClusterNode, error)

func ParseClusterNodesExludeSelf

func ParseClusterNodesExludeSelf(clusterNodesTxt string) ([]*ClusterNode, error)

func (*ClusterNode) HasSlots

func (c *ClusterNode) HasSlots() bool

func (*ClusterNode) IsMaster

func (c *ClusterNode) IsMaster() bool

func (*ClusterNode) SlotCount

func (c *ClusterNode) SlotCount() int

func (*ClusterNode) String

func (c *ClusterNode) String() string

type ClusterSlotRange

type ClusterSlotRange struct {
	Start int
	End   int
}

func SlotRanges

func SlotRanges(numShards int) []*ClusterSlotRange

func (*ClusterSlotRange) String

func (c *ClusterSlotRange) String() string

type Reshard

type Reshard struct {
	FromID string
	ToID   string
	Slots  int
}

func GenerateReshardingPlan

func GenerateReshardingPlan(clusterNodesForShard map[int][]*ClusterNode, desiredShards int) ([]Reshard, error)

Jump to

Keyboard shortcuts

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