Documentation
¶
Index ¶
- Constants
- func DumpFile(filename string, params any) error
- func NewBackupConfigs(serviceConfig *BackupServiceConfig, logger *slog.Logger) (*backup.ConfigBackup, *backup.ConfigBackupXDR, error)
- func NewInfoPolicy(timeOut int64) *aerospike.InfoPolicy
- func NewRestoreConfig(serviceConfig *RestoreServiceConfig, logger *slog.Logger) *backup.ConfigRestore
- func NewRetryPolicy(retryBaseTimeout int64, retryMultiplier float64, retryMaxRetries uint) *bModels.RetryPolicy
- func NewSecretAgent(b *backup.ConfigBackup, bxdr *backup.ConfigBackupXDR) *backup.SecretAgentConfig
- func ParseRacks(racks string) ([]int, error)
- func SplitByComma(s string) []string
- func ValidatePartitionFilters(partitionFilters []*aerospike.PartitionFilter) error
- func ValidateStorages(isBackup bool, awsS3 *models.AwsS3, gcpStorage *models.GcpStorage, ...) error
- type BackupServiceConfig
- type RestoreServiceConfig
Constants ¶
const MaxRack = 1000000
MaxRack max number of racks that can exist.
Variables ¶
This section is empty.
Functions ¶
func NewBackupConfigs ¶
func NewBackupConfigs(serviceConfig *BackupServiceConfig, logger *slog.Logger, ) (*backup.ConfigBackup, *backup.ConfigBackupXDR, error)
NewBackupConfigs creates and returns a new ConfigBackup and ConfigBackupXDR object, initialized with given backup parameters. This function sets various backup parameters including namespace, file limits, parallelism options, bandwidth, compression, encryption, and partition filters. It returns an error if any validation or parsing fails. If the backup is an XDR backup, it will return a ConfigBackupXDR object. Otherwise, it will return a ConfigBackup object.
func NewInfoPolicy ¶
func NewInfoPolicy(timeOut int64) *aerospike.InfoPolicy
NewInfoPolicy creates and returns a new InfoPolicy with the specified timeout.
func NewRestoreConfig ¶
func NewRestoreConfig(serviceConfig *RestoreServiceConfig, logger *slog.Logger) *backup.ConfigRestore
NewRestoreConfig creates and returns a new ConfigRestore object, initialized with given restore parameters.
func NewRetryPolicy ¶
func NewRetryPolicy(retryBaseTimeout int64, retryMultiplier float64, retryMaxRetries uint) *bModels.RetryPolicy
NewRetryPolicy creates and returns a new RetryPolicy with the specified interval, max retries and multiplier.
func NewSecretAgent ¶
func NewSecretAgent(b *backup.ConfigBackup, bxdr *backup.ConfigBackupXDR) *backup.SecretAgentConfig
NewSecretAgent determines and returns the SecretAgentConfig from ConfigBackup or ConfigBackupXDR. Returns nil if both are nil.
func ParseRacks ¶
ParseRacks parses a comma-separated string of rack IDs into a slice of positive integers. Returns an error if any ID is invalid or exceeds the allowed maximum limit.
func SplitByComma ¶
SplitByComma splits a comma-separated string into a slice of strings. Returns nil if the input string is empty.
func ValidatePartitionFilters ¶
func ValidatePartitionFilters(partitionFilters []*aerospike.PartitionFilter) error
func ValidateStorages ¶
Types ¶
type BackupServiceConfig ¶
type BackupServiceConfig struct { App *models.App ClientConfig *client.AerospikeConfig ClientPolicy *models.ClientPolicy Backup *models.Backup BackupXDR *models.BackupXDR Compression *models.Compression Encryption *models.Encryption SecretAgent *models.SecretAgent AwsS3 *models.AwsS3 GcpStorage *models.GcpStorage AzureBlob *models.AzureBlob }
BackupServiceConfig represents the configuration structure for the backup service involving various policies and integrations.
func NewBackupServiceConfig ¶
func NewBackupServiceConfig( app *models.App, clientConfig *client.AerospikeConfig, clientPolicy *models.ClientPolicy, backupScan *models.Backup, backupXDR *models.BackupXDR, compression *models.Compression, encryption *models.Encryption, secretAgent *models.SecretAgent, awsS3 *models.AwsS3, gcpStorage *models.GcpStorage, azureBlob *models.AzureBlob, ) (*BackupServiceConfig, error)
NewBackupServiceConfig initializes and returns a BackupServiceConfig struct with the provided configuration components. It optionally loads configuration from a file if specified in the app.ConfigFilePath.
func (*BackupServiceConfig) IsContinue ¶
func (p *BackupServiceConfig) IsContinue() bool
IsContinue determines if the backup configuration is a continue backup by checking if Backup is non-nil and Continue is non-empty.
func (*BackupServiceConfig) IsStopXDR ¶
func (p *BackupServiceConfig) IsStopXDR() bool
IsStopXDR checks if the backup operation should stop XDR by verifying that BackupXDR is non-nil and StopXDR is true.
func (*BackupServiceConfig) IsUnblockMRT ¶
func (p *BackupServiceConfig) IsUnblockMRT() bool
IsUnblockMRT checks if the backup operation should unblock MRT writes by verifying that BackupXDR is non-nil and UnblockMRT is true.
func (*BackupServiceConfig) IsXDR ¶
func (p *BackupServiceConfig) IsXDR() bool
IsXDR determines if the backup configuration is an XDR backup by checking if BackupXDR is non-nil and Backup is nil.
func (*BackupServiceConfig) SkipWriterInit ¶
func (p *BackupServiceConfig) SkipWriterInit() bool
SkipWriterInit checks if the backup operation should skip writer initialization by verifying that Backup is non-nil and Estimate is false.
type RestoreServiceConfig ¶
type RestoreServiceConfig struct { App *models.App ClientConfig *client.AerospikeConfig ClientPolicy *models.ClientPolicy Restore *models.Restore Compression *models.Compression Encryption *models.Encryption SecretAgent *models.SecretAgent AwsS3 *models.AwsS3 GcpStorage *models.GcpStorage AzureBlob *models.AzureBlob }
RestoreServiceConfig contains configuration settings for the restore service, including client, restore, and storage details.
func NewRestoreServiceConfig ¶
func NewRestoreServiceConfig( app *models.App, clientConfig *client.AerospikeConfig, clientPolicy *models.ClientPolicy, restore *models.Restore, compression *models.Compression, encryption *models.Encryption, secretAgent *models.SecretAgent, awsS3 *models.AwsS3, gcpStorage *models.GcpStorage, azureBlob *models.AzureBlob, ) (*RestoreServiceConfig, error)
NewRestoreServiceConfig creates and returns a new RestoreServiceConfig initialized with the provided parameters. If a config file path is specified in the app, parameters are loaded from the file instead. Returns an error if the config file cannot be loaded or parsed.