types

package
v0.0.0-...-3430a5a Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailoverMonitor

type FailoverMonitor interface {
	Policy() databasesv1.FailoverPolicy
	Master(ctx context.Context, flags ...bool) (*redis.SentinelMonitorNode, error)
	Replicas(ctx context.Context) ([]*redis.SentinelMonitorNode, error)
	Inited(ctx context.Context) (bool, error)
	AllNodeMonitored(ctx context.Context) (bool, error)
	UpdateConfig(ctx context.Context, params map[string]string) error
	Failover(ctx context.Context) error
	Monitor(ctx context.Context, node rtypes.RedisNode) error
}

type InstanceStatus

type InstanceStatus string
const (
	Any    InstanceStatus = ""
	OK     InstanceStatus = "OK"
	Fail   InstanceStatus = "Fail"
	Paused InstanceStatus = "Paused"
)

type Object

type Object interface {
	v1.Object
	GetObjectKind() schema.ObjectKind
	DeepCopyObject() runtime.Object
	NamespacedName() client.ObjectKey
	Version() rtypes.RedisVersion
	IsReady() bool

	Restart(ctx context.Context, annotationKeyVal ...string) error
	Refresh(ctx context.Context) error
}

type RedisClusterInstance

type RedisClusterInstance interface {
	RedisInstance

	Definition() *clusterv1.DistributedRedisCluster
	Status() *clusterv1.DistributedRedisClusterStatus

	Masters() []rtypes.RedisNode
	Nodes() []rtypes.RedisNode
	RawNodes(ctx context.Context) ([]corev1.Pod, error)
	Shards() []RedisClusterShard
	RewriteShards(ctx context.Context, shards []*clusterv1.ClusterShards) error
}

RedisInstance

type RedisClusterShard

type RedisClusterShard interface {
	Object

	Definition() *appv1.StatefulSet
	Status() *appv1.StatefulSetStatus

	Index() int
	Nodes() []rtypes.RedisNode
	// Master returns the master node of this shard which has joined the cluster
	// Keep in mind that, this not means the master has been assigned slots
	Master() rtypes.RedisNode
	// Replicas returns nodes whoses role is slave
	Replicas() []rtypes.RedisNode

	// Slots returns the slots of this shard
	Slots() *slot.Slots
	IsImporting() bool
	IsMigrating() bool
}

RedisClusterShard

type RedisFailoverInstance

type RedisFailoverInstance interface {
	RedisInstance

	Definition() *databasesv1.RedisFailover
	Masters() []rtypes.RedisNode
	Nodes() []rtypes.RedisNode
	RawNodes(ctx context.Context) ([]corev1.Pod, error)
	Monitor() FailoverMonitor

	IsBindedSentinel() bool
	IsStandalone() bool
	Selector() map[string]string
}

type RedisInstance

type RedisInstance interface {
	Object

	Arch() rtypes.RedisArch
	Users() acl.Users
	TLSConfig() *tls.Config
	IsInService() bool
	IsACLUserExists() bool
	IsACLAppliedToAll() bool
	IsResourceFullfilled(ctx context.Context) (bool, error)
	UpdateStatus(ctx context.Context, st InstanceStatus, message string) error
	SendEventf(eventtype, reason, messageFmt string, args ...interface{})
	Logger() logr.Logger
}

type RedisReplication

type RedisReplication interface {
	Object

	Definition() *appv1.StatefulSet
	Status() *appv1.StatefulSetStatus

	// Master returns the master node of this shard which has joined the cluster
	// Keep in mind that, this not means the master has been assigned slots
	Master() rtypes.RedisNode
	// Replicas returns nodes whoses role is slave
	Replicas() []rtypes.RedisNode
	Nodes() []rtypes.RedisNode
}

type RedisSentinel

type RedisSentinel interface {
	Object

	Definition() *appv1.Deployment
	Status() *appv1.DeploymentStatus

	Nodes() []rtypes.RedisSentinelNode
}

type RedisSentinelInstance

type RedisSentinelInstance interface {
	RedisInstance

	Definition() *databasesv1.RedisSentinel
	Replication() RedisSentinelReplication
	Nodes() []rtypes.RedisSentinelNode
	RawNodes(ctx context.Context) ([]corev1.Pod, error)

	// helper methods
	GetPassword() (string, error)

	Selector() map[string]string
}

type RedisSentinelReplication

type RedisSentinelReplication interface {
	Object

	Definition() *appv1.StatefulSet
	Status() *appv1.StatefulSetStatus

	Nodes() []rtypes.RedisSentinelNode
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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