command

package
v25.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectionFlags

func ConnectionFlags(co *CommandOpts, mariadb interfaces.Connector,
	connectionFlagOpts ...ConnectionFlagOpt) (string, error)

Types

type BackupCommand

type BackupCommand struct {
	BackupOpts
}

func NewBackupCommand

func NewBackupCommand(userOpts ...BackupOpt) (*BackupCommand, error)

func (*BackupCommand) MariadbBackup

func (b *BackupCommand) MariadbBackup(mariadb *mariadbv1alpha1.MariaDB, backupFilePath string,
	targetPodIndex int) (*Command, error)

func (*BackupCommand) MariadbBackupRestore

func (b *BackupCommand) MariadbBackupRestore(mariadb *mariadbv1alpha1.MariaDB, backupDirPath string,
	restoreOpts ...MariaDBBackupRestoreOpt) (*Command, error)

func (*BackupCommand) MariadbDump

func (b *BackupCommand) MariadbDump(backup *mariadbv1alpha1.Backup,
	mariadb interfaces.MariaDBObject) (*Command, error)

func (*BackupCommand) MariadbOperatorBackup

func (b *BackupCommand) MariadbOperatorBackup(backupContentType mariadbv1alpha1.BackupContentType) *Command

func (*BackupCommand) MariadbOperatorRestore

func (b *BackupCommand) MariadbOperatorRestore(backupContentType mariadbv1alpha1.BackupContentType, backupDirPath *string) *Command

func (*BackupCommand) MariadbRestore

func (b *BackupCommand) MariadbRestore(restore *mariadbv1alpha1.Restore,
	mariadb interfaces.MariaDBObject) (*Command, error)

type BackupOpt

type BackupOpt func(*BackupOpts)

func WithBackup

func WithBackup(path string, targetFilePath string) BackupOpt

func WithBackupDatabase

func WithBackupDatabase(d string) BackupOpt

func WithBackupLogLevel

func WithBackupLogLevel(l string) BackupOpt

func WithBackupMaxRetention

func WithBackupMaxRetention(d time.Duration) BackupOpt

func WithBackupPasswordEnv

func WithBackupPasswordEnv(p string) BackupOpt

func WithBackupTargetTime

func WithBackupTargetTime(t time.Time) BackupOpt

func WithBackupUserEnv

func WithBackupUserEnv(u string) BackupOpt

func WithCleanupTargetFile

func WithCleanupTargetFile(shouldCleanup bool) BackupOpt

func WithExtraOpts

func WithExtraOpts(opts []string) BackupOpt

func WithOmitCredentials

func WithOmitCredentials(omit bool) BackupOpt

func WithS3

func WithS3(bucket, endpoint, region, prefix string) BackupOpt

func WithS3CACertPath

func WithS3CACertPath(caCertPath string) BackupOpt

func WithS3TLS

func WithS3TLS(tls bool) BackupOpt

type BackupOpts

type BackupOpts struct {
	CommandOpts
	Path                 string
	TargetFilePath       string
	OmitCredentials      bool
	CleanupTargetFile    bool
	MaxRetentionDuration time.Duration
	TargetTime           time.Time
	Compression          mariadbv1alpha1.CompressAlgorithm
	S3                   bool
	S3Bucket             string
	S3Endpoint           string
	S3Region             string
	S3TLS                bool
	S3CACertPath         string
	S3Prefix             string
	LogLevel             string
	ExtraOpts            []string
}

type Command

type Command struct {
	Command []string
	Args    []string
}

func NewBashCommand

func NewBashCommand(args []string) *Command

func NewCommand

func NewCommand(cmd, args []string) *Command

type CommandOpts

type CommandOpts struct {
	UserEnv     string
	PasswordEnv string
	Database    *string
}

type ConnectionFlagOpt added in v25.8.3

type ConnectionFlagOpt func(*ConnectionFlagsOpts)

func WithHostConnectionFlag added in v25.8.3

func WithHostConnectionFlag(host string) ConnectionFlagOpt

type ConnectionFlagsOpts added in v25.8.3

type ConnectionFlagsOpts struct {
	Host string
}

type MariaDBBackupRestoreOpt added in v25.10.0

type MariaDBBackupRestoreOpt func(*MariaDBBackupRestoreOpts)

func WithCleanupDataDir added in v25.10.0

func WithCleanupDataDir(cleanup bool) MariaDBBackupRestoreOpt

type MariaDBBackupRestoreOpts added in v25.10.0

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

type SqlCommand

type SqlCommand struct {
	*SqlOpts
}

func NewSqlCommand

func NewSqlCommand(userOpts ...SqlOpt) (*SqlCommand, error)

func (*SqlCommand) ExecCommand

func (s *SqlCommand) ExecCommand(mariadb interfaces.Connector) (*Command, error)

func (*SqlCommand) SqlFlags

func (s *SqlCommand) SqlFlags(mdb interfaces.Connector) (string, error)

type SqlOpt

type SqlOpt func(*SqlOpts)

func WithSSL

func WithSSL(caPath, certPath, keyPath string) SqlOpt

func WithSqlDatabase

func WithSqlDatabase(d string) SqlOpt

func WithSqlFile

func WithSqlFile(f string) SqlOpt

func WithSqlPasswordEnv

func WithSqlPasswordEnv(p string) SqlOpt

func WithSqlUserEnv

func WithSqlUserEnv(u string) SqlOpt

type SqlOpts

type SqlOpts struct {
	CommandOpts
	SSLCAPath   *string
	SSLCertPath *string
	SSLKeyPath  *string
	SqlFile     string
}

Jump to

Keyboard shortcuts

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