Categorygithub.com/kubernetes-app/redisutil
modulepackage
1.0.1
Repository: https://github.com/kubernetes-app/redisutil.git
Documentation: pkg.go.dev

# README

redisutil

# Packages

Copyright 2021 kubernetes-app Solutions.

# Functions

AddSlots return a new list of slots after adding some slots in it, duplicates are removed.
BuildSlotSlice return a slice of all slots between this range.
Contains returns true if a node slice contains a node.
DecodeClusterInfos decode from the cmd output the Redis nodes info.
DecodeNodeInfos decode from the cmd output the Redis nodes info.
DecodeSlot parse a string representation of a slot slot.
DecodeSlotRange decode from a string a RangeSlot each entry can have 4 representations: * single slot: ex: 42 * slot range: ex: 42-52 * migrating slot: ex: [42->-67ed2db8d677e59ec4a4cefb06858cf2a1a89fa1] * importing slot: ex: [42-<-67ed2db8d677e59ec4a4cefb06858cf2a1a89fa1].
IsInconsistentError eturns true if the error is due to cluster inconsistencies.
IsNodeNotFoundedError returns true if the current error is a NodeNotFoundedError.
IsPartialError returns true if the error is due to partial data recovery.
LessByID compare 2 Nodes with there ID.
MoreByID compare 2 Nodes with there ID.
NewAdmin returns new AdminInterface instance at the same time it connects to all Redis Nodes thanks to the addrs list.
No description provided by the author
No description provided by the author
NewClusterInfosError returns an instance of cluster infos error.
NewDefaultNode builds and returns new defaultNode instance.
NewNode builds and returns new Node instance.
RemoveSlots return a new list of slot where a list of slots have been removed, doesn't work if duplicates.
No description provided by the author
SlotRangesFromSlots return a slice of slot ranges from a slice of slots.

# Constants

ClusterStatusCalculatingRebalancing ClusterStatus Rebalancing.
ClusterStatusKO ClusterStatus KO.
ClusterStatusOK ClusterStatus OK.
ClusterStatusRebalancing ClusterStatus Rebalancing.
ClusterStatusRollingUpdate ClusterStatus RollingUpdate.
ClusterStatusScaling ClusterStatus Scaling.
DefaultRedisPort define the default Redis Port.
HashMaxSlots Numbers or Redis slots used for Key hashing.
NodesPlacementInfoBestEffort the cluster nodes placement is in best effort, it means you can have 2 masters (or more) on the same VM.
NodesPlacementInfoOptimal the cluster nodes placement is optimal, it means on master by VM.
NodeStatusFail Node is in FAIL state.
NodeStatusHandshake Untrusted node, we are handshaking.
NodeStatusNoAddr No address known for this node.
NodeStatusNoFlags no flags at all.
NodeStatusPFail Node is in PFAIL state.
RedisLinkStateConnected redis connection status connected.
RedisLinkStateDisconnected redis connection status disconnected.
RedisMasterRole redis role master.
RedisNoneRole redis none role.
RedisSlaveRole redis role slave.
RedisStandaloneRole redis role standalone.
ResetHard HARD mode for RESET command.
ResetSoft SOFT mode for RESET command.

# Variables

IsMasterWithNoSlot anonymous function for searching Master Node with no slot.
IsMasterWithSlot anonymous function for searching Master Node withslot.
IsSlave anonymous function for searching Slave Node.

# Structs

Admin wraps redis cluster admin logic.
ClusterInfosError error type for redis cluster infos access.
ImportingSlot represents an importing slot (slot + importing from node id).
MigratingSlot represents a migrating slot (slot + migrating to node id).
Node Represent a Redis Node.
SlotRange represent a Range of slots.

# Interfaces

AdminInterface redis cluster admin interface.

# Type aliases

ClusterStatus Redis Cluster status.
Error used to represent an error.
FindNodeFunc function for finding a Node it is use as input for GetNodeByFunc and GetNodesByFunc.
Nodes represent a Node slice.
NodesPlacementInfo Redis Nodes placement mode information.
Slot represent a Redis Cluster slot.
SlotSlice attaches the methods of sort.Interface to []string, sorting in increasing order.