cmd

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: AGPL-3.0, AGPL-3.0-only Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Cfg is the shared runtime configuration bound to root persistent flags.

P is the active printer for the current command invocation.

View Source
var RootCmd = &cobra.Command{
	Use:   "hasteward",
	Short: "HASteward - High Availability Steward for database clusters",
	Long: `HASteward safely triages, repairs, backs up, and restores
database clusters managed by CNPG (PostgreSQL) and MariaDB Operator (Galera).

Backups are stored in restic repositories with block-level dedup,
encryption, and compression.`,
	SilenceUsage:  true,
	SilenceErrors: true,
}

RootCmd is the top-level cobra command.

Functions

func InitPrinter

func InitPrinter(command string) (*printer.Printer, error)

InitPrinter creates the printer for the current command. In json/jsonl modes, legacy output functions are silenced so only the printer writes to stdout.

func IsDryRun

func IsDryRun() bool

IsDryRun returns whether --dry-run was specified.

func PreRun

func PreRun(cmd *cobra.Command, mode string) (provider.EngineProvider, error)

PreRun validates required flags, initializes K8s clients, and resolves the engine provider.

func ResolveDonor

func ResolveDonor(cmd *cobra.Command) error

ResolveDonor parses the --donor flag into Cfg.DonorInstance.

func ResolveInstance

func ResolveInstance(cmd *cobra.Command) error

ResolveInstance parses the --instance flag into Cfg.InstanceNumber.

Types

This section is empty.

Jump to

Keyboard shortcuts

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