redisc

package
v0.0.0-...-12521ac Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// UnusedHashSlot unused slot flag
	UnusedHashSlot = iota
	// NewHashSlot new solt flag
	NewHashSlot
	// AssignedHashSlot assigned slot flag
	AssignedHashSlot
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterNode

type ClusterNode struct {
	Info          *Node
	Dirty         bool
	Friends       [](*Node)
	ReplicasNodes [](*ClusterNode)
	// contains filtered or unexported fields
}

ClusterNode redis cluster node

func NewClusterNode

func NewClusterNode(addr string) (*ClusterNode, error)

NewClusterNode return a new cluster node

func (*ClusterNode) AddSlots

func (cn *ClusterNode) AddSlots(start, end int)

AddSlots add slot to cluster node

func (*ClusterNode) Addr

func (cn *ClusterNode) Addr() string

Addr cluster node addr

func (*ClusterNode) Call

func (cn *ClusterNode) Call(cmd string, args ...interface{}) (interface{}, error)

Call call client do somethings

func (*ClusterNode) ClusterAddNode

func (cn *ClusterNode) ClusterAddNode(addr string) (ret string, err error)

ClusterAddNode add node to cluster

func (*ClusterNode) ClusterAddSlots

func (cn *ClusterNode) ClusterAddSlots(args ...interface{}) (ret string, err error)

ClusterAddSlots add slot to cluster node

func (*ClusterNode) ClusterCountKeysInSlot

func (cn *ClusterNode) ClusterCountKeysInSlot(slot int) (int, error)

ClusterCountKeysInSlot clount key in slot

func (*ClusterNode) ClusterDelSlots

func (cn *ClusterNode) ClusterDelSlots(args ...interface{}) (ret string, err error)

ClusterDelSlots delete slot from cluster node

func (*ClusterNode) ClusterForgetNodeID

func (cn *ClusterNode) ClusterForgetNodeID(nodeid string) (ret string, err error)

ClusterForgetNodeID remove a node from cluster

func (*ClusterNode) ClusterGetKeysInSlot

func (cn *ClusterNode) ClusterGetKeysInSlot(slot int, pipeline int) (string, error)

ClusterGetKeysInSlot get key form slot

func (*ClusterNode) ClusterReplicateWithNodeID

func (cn *ClusterNode) ClusterReplicateWithNodeID(nodeid string) (ret string, err error)

ClusterReplicateWithNodeID add replica node

func (*ClusterNode) ClusterSetSlot

func (cn *ClusterNode) ClusterSetSlot(slot int, cmd string) (string, error)

ClusterSetSlot set cluster slot

func (*ClusterNode) FlushNodeConfig

func (cn *ClusterNode) FlushNodeConfig()

FlushNodeConfig flush node config

func (*ClusterNode) GetConfigSignature

func (cn *ClusterNode) GetConfigSignature() string

GetConfigSignature get cluster node config signature

func (*ClusterNode) HasFlag

func (cn *ClusterNode) HasFlag(flag string) bool

HasFlag has flag

func (*ClusterNode) LoadInfo

func (cn *ClusterNode) LoadInfo() error

LoadInfo get cluster info from current node

type Node

type Node struct {
	Name       string
	IP         string
	Port       int
	Flags      []string
	Replicate  string
	PingSent   int
	PingRecv   int
	Weight     int
	Balance    int
	LinkStatus string
	Slots      map[int]int
	Migrating  map[int]string
	Importing  map[int]string
}

Node redis instance attributes

Jump to

Keyboard shortcuts

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