backup

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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backup

func Backup(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, logger logr.Logger) error

func BgSave

func BgSave(redisPassword, appendCommands, svcName string, logger logr.Logger)

func CopyFile

func CopyFile(sourceFile, destinationFile string, logger logr.Logger) error

func ExecBgSave

func ExecBgSave(cliCmd *exec.Cmd, podName string, logger logr.Logger) error

func ExecLastSave

func ExecLastSave(cliCmd *exec.Cmd, podName string, logger logr.Logger) (string, error)

func ExtractMyselfSlots

func ExtractMyselfSlots(data string) string

func FileExists

func FileExists(filename string) bool

func FileToString

func FileToString(filename string) (string, error)

func GenerateRandomCode

func GenerateRandomCode(length int) (string, error)

func KubectlExec

func KubectlExec(podName, containerName string, logger logr.Logger, command *exec.Cmd) (string, error)

func KubectlRedisDump

func KubectlRedisDump(podName, clusterIndex string, logger logr.Logger) error

func NewCommand

func NewCommand(ctx context.Context) *cli.Command

func Pull

func Pull(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, logger logr.Logger) error

func PushFile2S3

func PushFile2S3(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, logger logr.Logger) error

func ReadFileToString

func ReadFileToString(filename string) string

func RenameCluster

func RenameCluster(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, logger logr.Logger) error

func Restore

func Restore(ctx context.Context, c *cli.Context, logger logr.Logger) error

func ScheduleCreateRedisBackup

func ScheduleCreateRedisBackup(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, logger logr.Logger) error

func SplitAndTrimSpace

func SplitAndTrimSpace(s string) []string

Types

type NodeInfo

type NodeInfo struct {
	Name         string    `json:"name,omitempty"`
	Host         string    `json:"host,omitempty"`
	Port         int64     `json:"port,omitempty"`
	Replicate    string    `json:"replicate,omitempty"`
	SLotsCount   int64     `json:"slots_count,omitempty"`
	Slots        [][]int64 `json:"slots,omitempty"`
	Flags        string    `json:"flags,omitempty"`
	CurrentEpoch int64     `json:"current_epoch,omitempty"`
}

Jump to

Keyboard shortcuts

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