Documentation ¶
Index ¶
- Variables
- func ConstructArgs(conf string, opts []string, command, source, dest string) []string
- func ConstructBRGlobalOptionsForBackup(backup *v1alpha1.Backup) ([]string, string, error)
- func ConstructBRGlobalOptionsForRestore(restore *v1alpha1.Restore) ([]string, error)
- func EnsureDirectoryExist(dirName string) error
- func GetOptionValueFromEnv(option, envPrefix string) string
- func GetOptions(provider v1alpha1.StorageProvider) []string
- func IsDirExist(path string) bool
- func IsFileExist(file string) bool
- func NewCRCli(kubeconfig string) (versioned.Interface, error)
- func NewEventRecorder(kubeCli kubernetes.Interface, source string) record.EventRecorder
- func NewKubeAndCRCli(kubeconfig string) (kubernetes.Interface, versioned.Interface, error)
- func NewKubeCli(kubeconfig string) (kubernetes.Interface, error)
- func NewRemoteStorage(backup *v1alpha1.Backup) (*blob.Bucket, error)
- func NormalizeBucketURI(bucket string) string
- func OpenDB(dsn string) (*sql.DB, error)
- func Suffix(version string) string
- func ValidCmdFlags(cmdPath string, flagSet *pflag.FlagSet)
- type GenericOptions
Constants ¶
This section is empty.
Variables ¶
var (
// DefaultVersion is the default tikv and br version
DefaultVersion = "4.0"
)
Functions ¶
func ConstructArgs ¶
ConstructArgs constructs the rclone args
func ConstructBRGlobalOptionsForBackup ¶
ConstructBRGlobalOptionsForBackup constructs BR global options for backup and also return the remote path.
func ConstructBRGlobalOptionsForRestore ¶
ConstructBRGlobalOptionsForRestore constructs BR global options for restore.
func EnsureDirectoryExist ¶
EnsureDirectoryExist create directory if does not exist
func GetOptionValueFromEnv ¶
GetOptionValueFromEnv get option's value from environment variable. If unset, return empty string.
func GetOptions ¶
func GetOptions(provider v1alpha1.StorageProvider) []string
GetOptions gets the rclone options
func IsDirExist ¶
IsDirExist return true if path exist and is a dir, other cases return false
func IsFileExist ¶
IsFileExist return true if file exist and is a regular file, other cases return false
func NewEventRecorder ¶
func NewEventRecorder(kubeCli kubernetes.Interface, source string) record.EventRecorder
NewEventRecorder return the specify source's recoder
func NewKubeAndCRCli ¶
NewKubeAndCRCli create both kube cli and CR cli
func NewKubeCli ¶
func NewKubeCli(kubeconfig string) (kubernetes.Interface, error)
NewKubeCli create a kubeCli Interface
func NewRemoteStorage ¶
NewRemoteStorage creates new remote storage
func NormalizeBucketURI ¶
NormalizeBucketURI normal bucket URL for rclone, e.g. s3://bucket -> s3:bucket
func ValidCmdFlags ¶
ValidCmdFlags verify that all flags are set
Types ¶
type GenericOptions ¶
type GenericOptions struct { Namespace string // ResourceName can be the name of a backup or restore resource ResourceName string TLSClient bool TLSCluster bool Host string Port int32 Password string User string TiKVVersion string }
GenericOptions contains the generic input arguments to the backup/restore command
func (*GenericOptions) GetDSN ¶
func (bo *GenericOptions) GetDSN(enabledTLSClient bool) (string, error)
func (*GenericOptions) GetTikvGCLifeTime ¶
func (bo *GenericOptions) GetTikvGCLifeTime(db *sql.DB) (string, error)
func (*GenericOptions) SetTikvGCLifeTime ¶
func (bo *GenericOptions) SetTikvGCLifeTime(db *sql.DB, gcTime string) error
func (*GenericOptions) String ¶
func (bo *GenericOptions) String() string