models

package
v0.0.0-...-0227cab Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadRedisNodes

func LoadRedisNodes(ctx context.Context, client kubernetes.ClientSet, sts *appv1.StatefulSet, newUser *user.User, logger logr.Logger) ([]redis.RedisNode, error)

LoadRedisNodes

func LoadRedisSentinelNodes

func LoadRedisSentinelNodes(ctx context.Context, client kubernetes.ClientSet, deploy *appv1.Deployment, newUser *user.User, logger logr.Logger) ([]redis.RedisNode, error)

func LoadSentinelRedisNodes

func LoadSentinelRedisNodes(ctx context.Context, client kubernetes.ClientSet, sts *appv1.StatefulSet, newUser *user.User, logger logr.Logger) ([]redis.RedisNode, error)

func NewRedisNode

func NewRedisNode(ctx context.Context, client kubernetes.ClientSet, sts *appv1.StatefulSet, pod *corev1.Pod, newUser *user.User, logger logr.Logger) (redis.RedisNode, error)

NewRedisNode

func NewRedisSentinelNode

func NewRedisSentinelNode(ctx context.Context, client kubernetes.ClientSet, deploy *appv1.Deployment, pod *corev1.Pod, newUser *user.User, logger logr.Logger) (redis.RedisNode, error)

Types

type RedisNode

type RedisNode struct {
	corev1.Pod
	// contains filtered or unexported fields
}

func (*RedisNode) Config

func (n *RedisNode) Config() map[string]string

func (*RedisNode) ConfigedMasterIP

func (n *RedisNode) ConfigedMasterIP() string

func (*RedisNode) ConfigedMasterPort

func (n *RedisNode) ConfigedMasterPort() string

func (*RedisNode) ContainerStatus

func (n *RedisNode) ContainerStatus() *corev1.ContainerStatus

ContainerStatus

func (*RedisNode) CurrentVersion

func (n *RedisNode) CurrentVersion() redis.RedisVersion

func (*RedisNode) DefaultIP

func (n *RedisNode) DefaultIP() net.IP

func (*RedisNode) DefaultInternalIP

func (n *RedisNode) DefaultInternalIP() net.IP

func (*RedisNode) Definition

func (n *RedisNode) Definition() *corev1.Pod

func (*RedisNode) GetPod

func (n *RedisNode) GetPod() *corev1.Pod

func (*RedisNode) ID

func (n *RedisNode) ID() string

ID get cluster id

TODO: if it's possible generate a const id, use this id as cluster id

func (*RedisNode) IPort

func (n *RedisNode) IPort() int

func (*RedisNode) IPs

func (n *RedisNode) IPs() []net.IP

func (*RedisNode) Index

func (n *RedisNode) Index() int

Index returns the index of the related pod

func (*RedisNode) Info

func (n *RedisNode) Info() rediscli.RedisInfo

func (*RedisNode) InternalIPort

func (n *RedisNode) InternalIPort() int

func (*RedisNode) InternalPort

func (n *RedisNode) InternalPort() int

func (*RedisNode) IsACLApplied

func (n *RedisNode) IsACLApplied() bool

func (*RedisNode) IsConnected

func (n *RedisNode) IsConnected() bool

IsConnected

func (*RedisNode) IsContainerReady

func (n *RedisNode) IsContainerReady() bool

IsContainerReady

func (*RedisNode) IsJoined

func (n *RedisNode) IsJoined() bool

IsJoined

func (*RedisNode) IsMasterFailed

func (n *RedisNode) IsMasterFailed() bool

IsMasterFailed

func (*RedisNode) IsMasterLinkUp

func (n *RedisNode) IsMasterLinkUp() bool

master_link_status is up

func (*RedisNode) IsReady

func (n *RedisNode) IsReady() bool

IsReady

func (*RedisNode) IsSentinelPod

func (n *RedisNode) IsSentinelPod() bool

func (*RedisNode) IsTerminating

func (n *RedisNode) IsTerminating() bool

IsTerminating

func (*RedisNode) MasterID

func (n *RedisNode) MasterID() string

func (*RedisNode) NodeIP

func (n *RedisNode) NodeIP() net.IP

func (*RedisNode) Port

func (n *RedisNode) Port() int

func (*RedisNode) Query

func (n *RedisNode) Query(ctx context.Context, cmd string, args ...any) (any, error)

func (*RedisNode) Refresh

func (n *RedisNode) Refresh(ctx context.Context) (err error)

Refresh not concurrency safe

func (*RedisNode) ReplicaOf

func (n *RedisNode) ReplicaOf(ctx context.Context, ip, port string) error

func (*RedisNode) Role

func (n *RedisNode) Role() redis.RedisRole

func (*RedisNode) SetACLUser

func (n *RedisNode) SetACLUser(ctx context.Context, username string, passwords []string, rules string) (interface{}, error)

func (*RedisNode) SetMonitor

func (n *RedisNode) SetMonitor(ctx context.Context, ip, port, user, password, quorum string) error

func (*RedisNode) Setup

func (n *RedisNode) Setup(ctx context.Context, margs ...[]any) (err error)

Setup only return the last command error

func (*RedisNode) Slots

func (n *RedisNode) Slots() *slot.Slots

Slots

func (*RedisNode) Status

func (n *RedisNode) Status() corev1.PodPhase

Status

type RedisSentinelNode

type RedisSentinelNode struct {
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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