redis

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisNode

type RedisNode struct {
	ID        string
	Pod       *corev1.Pod
	IP        string
	Flags     []string
	MasterID  string
	Epoch     int
	LinkState string
	Slots     []string
}

func (*RedisNode) IsMaster

func (n *RedisNode) IsMaster() bool

func (*RedisNode) SlotsCount

func (n *RedisNode) SlotsCount() int

func (*RedisNode) String

func (n *RedisNode) String() string

type RedisPod

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

func NewRedisPod

func NewRedisPod(podname string, redisContainerName string, namespace string, port int, clientset *kubernetes.Clientset, restcfg *restclient.Config) (*RedisPod, error)

func NewRedisPodWithPod

func NewRedisPodWithPod(pod *corev1.Pod, redisContainerName string, port int, clientset *kubernetes.Clientset, restcfg *restclient.Config) *RedisPod

func (*RedisPod) Call

func (r *RedisPod) Call(cmd ...string) (string, error)

func (*RedisPod) ClusterAddNode

func (r *RedisPod) ClusterAddNode(newPod *RedisPod, slave bool) (result string, err error)

func (*RedisPod) ClusterCheck

func (r *RedisPod) ClusterCheck() error

func (*RedisPod) ClusterCreate

func (r *RedisPod) ClusterCreate(replicas int, yes bool, pods ...*RedisPod) (string, error)

func (*RedisPod) ClusterDelNode

func (r *RedisPod) ClusterDelNode(nodeID string) (result string, err error)

func (*RedisPod) ClusterFailover

func (r *RedisPod) ClusterFailover(force, takeover bool) (string, error)

func (*RedisPod) ClusterInfo

func (r *RedisPod) ClusterInfo() (string, error)

func (*RedisPod) ClusterNodes

func (r *RedisPod) ClusterNodes() (nodes []*RedisNode, err error)

ClusterNodes return redis nodes with pod info

func (*RedisPod) ClusterRebalance

func (r *RedisPod) ClusterRebalance(weights map[string]string, useEmptyMasters bool, timeout int, simulate bool, batch int, threshold int, replace bool) (string, error)

func (*RedisPod) ClusterSlots

func (r *RedisPod) ClusterSlots() ([]*Slots, error)

func (*RedisPod) ConfigGet

func (r *RedisPod) ConfigGet(key string) (string, error)

func (*RedisPod) ConfigSet

func (r *RedisPod) ConfigSet(key, value string) (string, error)

func (*RedisPod) GetIP

func (r *RedisPod) GetIP() string

func (*RedisPod) GetName

func (r *RedisPod) GetName() string

func (*RedisPod) GetNodeID

func (r *RedisPod) GetNodeID() (nodeID string, err error)

func (*RedisPod) Ping

func (r *RedisPod) Ping() (string, error)

type Slots

type Slots struct {
	Start  int
	End    int
	Master *RedisPod
	Slaves []*RedisPod
}

Jump to

Keyboard shortcuts

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