flags

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SectionTextUsageBackup  = "\nUsage:\n  absctl backup [flags]"
	SectionTextUsageRestore = "\nUsage:\n  absctl restore [flags]"

	SectionTextSecretAgentBackup = "\nSecret Agent Flags:\n" +
		"Options pertaining to the Aerospike Secret Agent.\n" +
		"See documentation here: https://aerospike.com/docs/tools/secret-agent.\n" +
		"Both backup and restore commands support getting all the cloud configuration parameters\n" +
		"from the Aerospike Secret Agent.\n" +
		"To use a secret as an option, use this format: 'secrets:<resource_name>:<secret_name>' \n" +
		"Example: absctl backup --azure-account-name secret:resource1:azaccount"
	SectionTextSecretAgentRestore = "\nSecret Agent Flags:\n" +
		"Options pertaining to the Aerospike Secret Agent.\n" +
		"See documentation here: https://aerospike.com/docs/tools/secret-agent.\n" +
		"Both backup and restore commands support getting all the cloud configuration parameters\n" +
		"from the Aerospike Secret Agent.\n" +
		"To use a secret as an option, use this format: 'secrets:<resource_name>:<secret_name>' \n" +
		"Example: absctl restore --azure-account-name secret:resource1:azaccount"

	SectionTextBackup  = "\nBackup Flags:"
	SectionTextRestore = "\nBackup Flags:"

	SectionTextGeneral     = "\nGeneral Flags:"
	SectionTextAerospike   = "\nAerospike Client Flags:"
	SectionTextCompression = "\nCompression Flags:"
	SectionTextEncryption  = "\nEncryption Flags:"

	SectionTextLocal = "\nLocal Storage Flags:"
	SectionTextAWS   = "\nAWS Storage Flags:\n" +
		"For S3, the storage bucket name must be set with the --s3-bucket-name flag.\n" +
		"--directory path will only contain the folder name.\n" +
		"--s3-endpoint-override is used for MinIO storage instead of AWS.\n" +
		"Any AWS parameter can be retrieved from Secret Agent."
	SectionTextGCP = "\nGCP Storage Flags:\n" +
		"For GCP storage, the bucket name must be set with --gcp-bucket-name flag.\n" +
		"--directory path will only contain the folder name.\n" +
		"The flag --gcp-endpoint-override  is optional, and is used for tests or any other GCP emulator.\n" +
		"Any GCP parameter can be retrieved from Secret Agent."
	SectionTextAzure = "\nAzure Storage Flags:\n" +
		"For Azure storage, the container name must be set with --azure-container-name flag.\n" +
		"--directory path will only contain folder name.\n" +
		"The flag --azure-endpoint is also mandatory, as each storage account has different service address.\n" +
		"For authentication, use --azure-account-name and --azure-account-key, or \n" +
		"--azure-tenant-id, --azure-client-id and --azure-client-secret.\n" +
		"Any Azure parameter can be retrieved from Secret Agent."
)

Variables

This section is empty.

Functions

func WrapFlagsForSecrets added in v1.1.0

func WrapFlagsForSecrets(fs *pflag.FlagSet)

WrapFlagsForSecrets replaces flag Values on Aerospike connection flags with deferred wrappers that accept Secret Agent references (secrets:resource:key). Must be called after NewFlagSet() and before the flagset is parsed by cobra.

CertFlag values get a specialised wrapper that bypasses Set() after resolution (the resolved value is cert content, not a file path). All other custom types get a generic wrapper that delegates to the original Set() after resolution.

Types

type App

type App struct {
	models.App
}

func NewApp

func NewApp() *App

func (*App) GetApp

func (f *App) GetApp() *models.App

GetApp returns the App struct.

func (*App) NewFlagSet

func (f *App) NewFlagSet() *pflag.FlagSet

func (*App) PreRun added in v1.1.0

func (f *App) PreRun(cmd *cobra.Command, sa *models.SecretAgent) error

PreRun contains logic that is executed right after flag parsing. Is used in backup/restore to preload secrets from SecretAgent for external libs.

type AwsS3

type AwsS3 struct {
	models.AwsS3
	// contains filtered or unexported fields
}

func NewAwsS3

func NewAwsS3(operation Operation) *AwsS3

func (*AwsS3) GetAwsS3

func (f *AwsS3) GetAwsS3() *models.AwsS3

func (*AwsS3) NewFlagSet

func (f *AwsS3) NewFlagSet() *pflag.FlagSet

type AzureBlob

type AzureBlob struct {
	models.AzureBlob
	// contains filtered or unexported fields
}

func NewAzureBlob

func NewAzureBlob(operation Operation) *AzureBlob

func (*AzureBlob) GetAzureBlob

func (f *AzureBlob) GetAzureBlob() *models.AzureBlob

func (*AzureBlob) NewFlagSet

func (f *AzureBlob) NewFlagSet() *pflag.FlagSet

type Backup

type Backup struct {
	models.Backup
}

func NewBackup

func NewBackup() *Backup

func (*Backup) GetBackup

func (f *Backup) GetBackup() *models.Backup

func (*Backup) NewFlagSet

func (f *Backup) NewFlagSet() *pflag.FlagSet

type BackupXDR

type BackupXDR struct {
	models.BackupXDR
}

func NewBackupXDR

func NewBackupXDR() *BackupXDR

func (*BackupXDR) GetBackupXDR

func (f *BackupXDR) GetBackupXDR() *models.BackupXDR

func (*BackupXDR) NewFlagSet

func (f *BackupXDR) NewFlagSet() *pflag.FlagSet

type ClientPolicy

type ClientPolicy struct {
	models.ClientPolicy
}

func NewClientPolicy

func NewClientPolicy() *ClientPolicy

func (*ClientPolicy) GetClientPolicy

func (f *ClientPolicy) GetClientPolicy() *models.ClientPolicy

func (*ClientPolicy) NewFlagSet

func (f *ClientPolicy) NewFlagSet() *pflag.FlagSet

type Common

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

func NewCommon

func NewCommon(fields *models.Common, operation Operation) *Common

func (*Common) GetCommon

func (f *Common) GetCommon() *models.Common

func (*Common) NewFlagSet

func (f *Common) NewFlagSet() *pflag.FlagSet

type Compression

type Compression struct {
	models.Compression
	// contains filtered or unexported fields
}

func NewCompression

func NewCompression(operation Operation) *Compression

func (*Compression) GetCompression

func (f *Compression) GetCompression() *models.Compression

func (*Compression) NewFlagSet

func (f *Compression) NewFlagSet() *pflag.FlagSet

type Encryption

type Encryption struct {
	models.Encryption
	// contains filtered or unexported fields
}

func NewEncryption

func NewEncryption(operation Operation) *Encryption

func (*Encryption) GetEncryption

func (f *Encryption) GetEncryption() *models.Encryption

func (*Encryption) NewFlagSet

func (f *Encryption) NewFlagSet() *pflag.FlagSet

type GcpStorage

type GcpStorage struct {
	models.GcpStorage
	// contains filtered or unexported fields
}

func NewGcpStorage

func NewGcpStorage(operation Operation) *GcpStorage

func (*GcpStorage) GetGcpStorage

func (f *GcpStorage) GetGcpStorage() *models.GcpStorage

func (*GcpStorage) NewFlagSet

func (f *GcpStorage) NewFlagSet() *pflag.FlagSet

type Local

type Local struct {
	models.Local
	// contains filtered or unexported fields
}

func NewLocal

func NewLocal(operation Operation) *Local

func (*Local) GetLocal

func (f *Local) GetLocal() *models.Local

func (*Local) NewFlagSet

func (f *Local) NewFlagSet() *pflag.FlagSet

type Operation added in v1.1.0

type Operation int
const (
	// OperationBackup is used to generate proper documentation for backup.
	OperationBackup Operation = iota
	// OperationRestore is used to generate proper documentation for restore.
	OperationRestore
)

type Restore

type Restore struct {
	models.Restore
}

func NewRestore

func NewRestore() *Restore

func (*Restore) GetRestore

func (f *Restore) GetRestore() *models.Restore

func (*Restore) NewFlagSet

func (f *Restore) NewFlagSet() *pflag.FlagSet

type Root

type Root struct {
	models.Root
}

func NewRoot

func NewRoot() *Root

func (*Root) GetRoot

func (f *Root) GetRoot() *models.Root

func (*Root) NewFlagSet

func (f *Root) NewFlagSet() *pflag.FlagSet

type SecretAgent

type SecretAgent struct {
	models.SecretAgent
}

func NewSecretAgent

func NewSecretAgent() *SecretAgent

func (*SecretAgent) GetSecretAgent

func (f *SecretAgent) GetSecretAgent() *models.SecretAgent

func (*SecretAgent) NewFlagSet

func (f *SecretAgent) NewFlagSet() *pflag.FlagSet

type ServerBackup added in v1.1.0

type ServerBackup struct {
	models.ServerBackup
}

func NewServerBackup added in v1.1.0

func NewServerBackup() *ServerBackup

func (*ServerBackup) GetIntegratedBackup added in v1.1.0

func (f *ServerBackup) GetIntegratedBackup() *models.ServerBackup

func (*ServerBackup) NewBackupCreateFlagSet added in v1.1.0

func (f *ServerBackup) NewBackupCreateFlagSet() *pflag.FlagSet

func (*ServerBackup) NewBackupListFlagSet added in v1.1.0

func (f *ServerBackup) NewBackupListFlagSet() *pflag.FlagSet

func (*ServerBackup) NewRestoreStartFlagSet added in v1.1.0

func (f *ServerBackup) NewRestoreStartFlagSet() *pflag.FlagSet

type ServiceBackupList added in v1.1.0

type ServiceBackupList struct {
	models.BackupListFilter
}

ServiceBackupList holds flags for the full/incremental list commands.

func NewServiceBackupList added in v1.1.0

func NewServiceBackupList() *ServiceBackupList

func (*ServiceBackupList) NewFlagSet added in v1.1.0

func (f *ServiceBackupList) NewFlagSet() *pflag.FlagSet

type ServiceBackupRoutine added in v1.1.0

type ServiceBackupRoutine struct {
	models.BackupRoutine
}

ServiceBackupRoutine holds the --name flag used by cancel and status commands.

func NewServiceBackupRoutine added in v1.1.0

func NewServiceBackupRoutine() *ServiceBackupRoutine

func (*ServiceBackupRoutine) NewFlagSet added in v1.1.0

func (f *ServiceBackupRoutine) NewFlagSet() *pflag.FlagSet

type ServiceBackupTrigger added in v1.1.0

type ServiceBackupTrigger struct {
	models.BackupTrigger
}

ServiceBackupTrigger holds flags for the full/incremental start commands.

func NewServiceBackupTrigger added in v1.1.0

func NewServiceBackupTrigger() *ServiceBackupTrigger

func (*ServiceBackupTrigger) NewFlagSet added in v1.1.0

func (f *ServiceBackupTrigger) NewFlagSet() *pflag.FlagSet

type ServiceConfigCluster added in v1.1.0

type ServiceConfigCluster struct {
	models.ConfigClusterFields
}

ServiceConfigCluster holds flags for the `service config clusters add|update` commands. Each leaf field of DtoAerospikeCluster is exposed as an individual flag;

func NewServiceConfigCluster added in v1.1.0

func NewServiceConfigCluster() *ServiceConfigCluster

func (*ServiceConfigCluster) NewFlagSet added in v1.1.0

func (f *ServiceConfigCluster) NewFlagSet() *pflag.FlagSet

type ServiceConfigFile added in v1.1.0

type ServiceConfigFile struct {
	models.ConfigUpdate
}

ServiceConfigFile holds the --file flag for replacing the full service configuration.

func NewServiceConfigFile added in v1.1.0

func NewServiceConfigFile() *ServiceConfigFile

func (*ServiceConfigFile) NewFlagSet added in v1.1.0

func (f *ServiceConfigFile) NewFlagSet() *pflag.FlagSet

type ServiceConfigName added in v1.1.0

type ServiceConfigName struct {
	models.ConfigResourceName
}

ServiceConfigName holds the --name flag for show/delete/enable/disable commands.

func NewServiceConfigName added in v1.1.0

func NewServiceConfigName() *ServiceConfigName

func (*ServiceConfigName) NewFlagSet added in v1.1.0

func (f *ServiceConfigName) NewFlagSet() *pflag.FlagSet

type ServiceConfigPolicy added in v1.1.0

type ServiceConfigPolicy struct {
	models.ConfigPolicyFields
}

ServiceConfigPolicy holds flags for the `service config policies add|update` commands. Each leaf field of DtoBackupPolicy is exposed as an individual flag;

func NewServiceConfigPolicy added in v1.1.0

func NewServiceConfigPolicy() *ServiceConfigPolicy

func (*ServiceConfigPolicy) NewFlagSet added in v1.1.0

func (f *ServiceConfigPolicy) NewFlagSet() *pflag.FlagSet

type ServiceConfigRoutine added in v1.1.0

type ServiceConfigRoutine struct {
	models.ConfigRoutineFields
}

ServiceConfigRoutine holds flags for the `service config routines add|update` commands. Each leaf field of DtoBackupRoutine is exposed as an individual flag;

func NewServiceConfigRoutine added in v1.1.0

func NewServiceConfigRoutine() *ServiceConfigRoutine

func (*ServiceConfigRoutine) NewFlagSet added in v1.1.0

func (f *ServiceConfigRoutine) NewFlagSet() *pflag.FlagSet

type ServiceConfigStorage added in v1.1.0

type ServiceConfigStorage struct {
	models.ConfigStorageFields
}

ServiceConfigStorage holds flags for the `service config storage add|update` commands. Storage wraps exactly one of local/s3/gcp/azure provider blocks; populating any field of a provider group selects that provider.

func NewServiceConfigStorage added in v1.1.0

func NewServiceConfigStorage() *ServiceConfigStorage

func (*ServiceConfigStorage) NewFlagSet added in v1.1.0

func (f *ServiceConfigStorage) NewFlagSet() *pflag.FlagSet

type ServiceConnection added in v1.1.0

type ServiceConnection struct {
	models.ServiceConnection
}

func NewServiceConnection added in v1.1.0

func NewServiceConnection() *ServiceConnection

func (*ServiceConnection) GetServiceConnection added in v1.1.0

func (f *ServiceConnection) GetServiceConnection() *models.ServiceConnection

func (*ServiceConnection) NewFlagSet added in v1.1.0

func (f *ServiceConnection) NewFlagSet() *pflag.FlagSet

type ServiceRestoreJobID added in v1.1.0

type ServiceRestoreJobID struct {
	models.RestoreJobID
}

ServiceRestoreJobID holds the --job-id flag used by cancel and status commands.

func NewServiceRestoreJobID added in v1.1.0

func NewServiceRestoreJobID() *ServiceRestoreJobID

func (*ServiceRestoreJobID) NewFlagSet added in v1.1.0

func (f *ServiceRestoreJobID) NewFlagSet() *pflag.FlagSet

type ServiceRestoreJobs added in v1.1.0

type ServiceRestoreJobs struct {
	models.RestoreJobsFilter
}

ServiceRestoreJobs holds flags for the jobs (list) command.

func NewServiceRestoreJobs added in v1.1.0

func NewServiceRestoreJobs() *ServiceRestoreJobs

func (*ServiceRestoreJobs) NewFlagSet added in v1.1.0

func (f *ServiceRestoreJobs) NewFlagSet() *pflag.FlagSet

type ServiceRestoreRequest added in v1.1.0

type ServiceRestoreRequest struct {
	models.RestoreRequest
}

ServiceRestoreRequest holds flags for the full and incremental restore commands.

func NewServiceRestoreRequest added in v1.1.0

func NewServiceRestoreRequest() *ServiceRestoreRequest

func (*ServiceRestoreRequest) NewFlagSet added in v1.1.0

func (f *ServiceRestoreRequest) NewFlagSet() *pflag.FlagSet

type ServiceRestoreTimestamp added in v1.1.0

type ServiceRestoreTimestamp struct {
	models.RestoreTimestampRequest
}

ServiceRestoreTimestamp holds flags for the timestamp restore command.

func NewServiceRestoreTimestamp added in v1.1.0

func NewServiceRestoreTimestamp() *ServiceRestoreTimestamp

func (*ServiceRestoreTimestamp) NewFlagSet added in v1.1.0

func (f *ServiceRestoreTimestamp) NewFlagSet() *pflag.FlagSet

Jump to

Keyboard shortcuts

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