models

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAppHelp           = false
	DefaultAppVersion        = false
	DefaultAppVerbose        = false
	DefaultAppLogLevel       = "debug"
	DefaultAppLogFile        = ""
	DefaultAppLogJSON        = false
	DefaultAppConfigFilePath = ""
)

App.

View Source
const (
	DefaultS3BucketName          = ""
	DefaultS3Region              = ""
	DefaultS3Profile             = ""
	DefaultS3Endpoint            = ""
	DefaultS3AccessKeyID         = ""
	DefaultS3SecretAccessKey     = ""
	DefaultS3StorageClass        = ""
	DefaultS3AccessTier          = ""
	DefaultS3RestorePollDuration = int64(60000)
	DefaultS3RetryMaxAttempts    = 10
	DefaultS3RetryMaxBackoff     = 90000
	DefaultS3ChunkSize           = 50
	DefaultS3UploadConcurrency   = 0
)

Aws S3 Storage.

View Source
const (
	DefaultAzureAccountName         = ""
	DefaultAzureAccountKey          = ""
	DefaultAzureTenantID            = ""
	DefaultAzureClientID            = ""
	DefaultAzureClientSecret        = ""
	DefaultAzureEndpoint            = ""
	DefaultAzureContainerName       = ""
	DefaultAzureAccessTier          = ""
	DefaultAzureRestorePollDuration = int64(60000)
	DefaultAzureRetryMaxAttempts    = 10
	DefaultAzureRetryDelay          = 60000
	DefaultAzureRetryMaxDelay       = 90000
	DefaultAzureBlockSize           = 50
	DefaultAzureUploadConcurrency   = 1
)

Azure Blob Storage

View Source
const (
	DefaultGcpKeyFile                = ""
	DefaultGcpBucketName             = ""
	DefaultGcpEndpoint               = ""
	DefaultGcpRetryMaxAttempts       = 10
	DefaultGcpRetryBackoffMax        = 90000
	DefaultGcpRetryBackoffInit       = 60000
	DefaultGcpRetryBackoffMultiplier = 2.0
	DefaultGcpChunkSize              = 50
)

Gpc Storage.

View Source
const (
	DefaultCloudMaxConnsPerHost      = 0
	DefaultCloudRequestTimeout       = 600000
	DefaultCloudCalculateChecksum    = false
	DefaultCloudRetryReadBackoff     = 1000
	DefaultCloudRetryReadMultiplier  = float64(2.0)
	DefaultCloudRetryReadMaxAttempts = uint(3)
)

Cloud common.

View Source
const (
	DefaultClientPolicyTimeout      = int64(30000)
	DefaultClientPolicyIdleTimeout  = int64(0)
	DefaultClientPolicyLoginTimeout = int64(10000)
)

Client Policy.

View Source
const (
	DefaultCompressionMode  = "NONE"
	DefaultCompressionLevel = 3
)

Compression.

View Source
const (
	DefaultEncryptionMode      = "NONE"
	DefaultEncryptionKeyFile   = ""
	DefaultEncryptionKeyEnv    = ""
	DefaultEncryptionKeySecret = ""
)

Encryption.

View Source
const (
	DefaultSecretAgentConnectionType     = "TCP"
	DefaultSecretAgentAddress            = ""
	DefaultSecretAgentPort               = 0
	DefaultSecretAgentTimeoutMillisecond = 10000
	DefaultSecretAgentCaFile             = ""
	DefaultSecretAgentTLSName            = ""
	DefaultSecretAgentCertFile           = ""
	DefaultSecretAgentKeyFile            = ""
	DefaultSecretAgentIsBase64           = false
)

Secret Agent.

View Source
const (
	DefaultCommonDirectory             = ""
	DefaultCommonNamespace             = ""
	DefaultCommonSetList               = ""
	DefaultCommonBinList               = ""
	DefaultCommonNoRecords             = false
	DefaultCommonNoIndexes             = false
	DefaultCommonNoUDFs                = false
	DefaultCommonRecordsPerSecond      = 0
	DefaultCommonSocketTimeout         = int64(10000)
	DefaultCommonInfoTimeout           = int64(10000)
	DefaultCommonInfoMaxRetries        = uint(3)
	DefaultCommonInfoRetriesMultiplier = 1.0
	DefaultCommonInfoRetryInterval     = int64(1000)
	DefaultCommonBandwidth             = int64(0)
	DefaultCommonStdBufferSize         = 4
)

Common for backup and restore.

View Source
const (
	DefaultBackupOutputFile          = ""
	DefaultBackupRemoveFiles         = false
	DefaultBackupModifiedBefore      = ""
	DefaultBackupModifiedAfter       = ""
	DefaultBackupFileLimit           = uint64(250)
	DefaultBackupAfterDigest         = ""
	DefaultBackupMaxRecords          = int64(0)
	DefaultBackupNoBins              = false
	DefaultBackupSleepBetweenRetries = 5
	DefaultBackupFilterExpression    = ""
	DefaultBackupRemoveArtifacts     = false
	DefaultBackupCompact             = false
	DefaultBackupNodeList            = ""
	DefaultBackupNoTTLOnly           = false
	DefaultBackupPreferRacks         = ""
	DefaultBackupPartitionList       = ""
	DefaultBackupEstimate            = false
	DefaultBackupEstimateSamples     = int64(10000)
	DefaultBackupStateFileDst        = ""
	DefaultBackupContinue            = ""
	DefaultBackupScanPageSize        = int64(10000)
	DefaultBackupOutputFilePrefix    = ""
	DefaultBackupRackList            = ""
	DefaultBackupTotalTimeout        = int64(0)
	DefaultBackupParallel            = 1
	DefaultBackupMaxRetries          = 5
)

Backup.

View Source
const (
	DefaultRestoreTotalTimeout       = int64(10000)
	DefaultRestoreParallel           = 0
	DefaultRestoreInputFile          = ""
	DefaultRestoreDirectoryList      = ""
	DefaultRestoreParentDirectory    = ""
	DefaultRestoreDisableBatchWrites = false
	DefaultRestoreBatchSize          = 128
	DefaultRestoreMaxAsyncBatches    = 32
	DefaultRestoreWarmUp             = 0
	DefaultRestoreExtraTTL           = int64(0)
	DefaultRestoreIgnoreRecordError  = false
	DefaultRestoreUniq               = false
	DefaultRestoreReplace            = false
	DefaultRestoreNoGeneration       = false
	DefaultRestoreRetryBaseInterval  = int64(1000)
	DefaultRestoreRetryMultiplier    = 1.0
	DefaultRestoreRetryMaxAttempts   = uint(0)

	DefaultRestoreValidateOnly      = false
	DefaultRestoreApplyMetadataLast = false
)

Restore.

View Source
const (
	DefaultServiceHost = "localhost"
	DefaultServicePort = 8080
)

Service connection.

View Source
const (
	DefaultBackupXDRDirectory             = ""
	DefaultBackupXDRFileLimit             = 250
	DefaultBackupXDRRemoveFiles           = false
	DefaultBackupXDRParallelWrite         = 0
	DefaultBackupXDRDC                    = "dc"
	DefaultBackupXDRLocalAddress          = "127.0.0.1"
	DefaultBackupXDRLocalPort             = 8080
	DefaultBackupXDRNamespace             = ""
	DefaultBackupXDRRewind                = "all"
	DefaultBackupXDRMaxThroughput         = 0
	DefaultBackupXDRReadTimeout           = 1000
	DefaultBackupXDRWriteTimeout          = 1000
	DefaultBackupXDRResultQueueSize       = 256
	DefaultBackupXDRAckQueueSize          = 256
	DefaultBackupXDRMaxConnections        = 4096
	DefaultBackupXDRInfoPolingPeriod      = 1000
	DefaultBackupXDRStartTimeout          = 30000
	DefaultBackupXDRInfoTimeout           = 10000
	DefaultBackupXDRStopXDR               = false
	DefaultBackupXDRUnblockMRT            = false
	DefaultBackupXDRInfoMaxRetries        = 3
	DefaultBackupXDRInfoRetriesMultiplier = 1.0
	DefaultBackupXDRInfoRetryInterval     = 1000
	DefaultBackupXDRForward               = false
)
View Source
const (
	RestoreModeAuto = "auto"
	RestoreModeASB  = "asb"
	RestoreModeASBX = "asbx"
)
View Source
const (
	DefaultLocalBufferSize = 4
)

noinspection GoCommentStart Local Storage.

View Source
const (
	ErrNodeNotFoundText = "namespace not found on node"
)
View Source
const MaxRack = 1000000

MaxRack max number of racks that can exist.

Variables

View Source
var (
	ErrNodeNotFound = errors.New(ErrNodeNotFoundText)
)

Functions

func ParseLocalTimeToUTC added in v1.1.0

func ParseLocalTimeToUTC(timeString string) (time.Time, error)

ParseLocalTimeToUTC parces local time to UTC.

func SplitByComma added in v1.1.0

func SplitByComma(s string) []string

SplitByComma splits a comma-separated string into a slice of strings. Returns nil if the input string is empty.

Types

type App

type App struct {
	Help bool

	Verbose bool
	// LogLevel Set log level for verbose output.
	LogLevel string
	// LogJSON Format logs as JSON, for parsing by external tools.
	LogJSON bool
	// LogFile Path to the log file, if logging to a file.
	LogFile string

	// ConfigFilePath is the path to the file used for tool configuration.
	ConfigFilePath string
}

App contains the global application flags.

type AwsS3

type AwsS3 struct {
	BucketName      string
	Region          string
	Profile         string
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string

	StorageClass        string
	AccessTier          string
	RestorePollDuration int64

	RetryMaxAttempts int
	RetryMaxBackoff  int

	ChunkSize         int
	UploadConcurrency int

	StorageCommon
}

AwsS3 represents the configuration for AWS S3 storage integration.

func (*AwsS3) IsConfigured added in v1.1.0

func (a *AwsS3) IsConfigured() bool

func (*AwsS3) Validate

func (a *AwsS3) Validate(isBackup bool) error

Validate internal validation for struct params.

type AzureBlob

type AzureBlob struct {
	// Account name + key auth
	AccountName string
	AccountKey  string
	// Azure Active directory
	TenantID     string
	ClientID     string
	ClientSecret string // #nosec G117

	Endpoint      string
	ContainerName string

	AccessTier          string
	RestorePollDuration int64

	RetryMaxAttempts int
	RetryDelay       int
	RetryMaxDelay    int

	BlockSize         int
	UploadConcurrency int

	StorageCommon
}

AzureBlob represents the configuration for Azure Blob storage integration.

func (*AzureBlob) IsConfigured added in v1.1.0

func (a *AzureBlob) IsConfigured() bool

func (*AzureBlob) Validate

func (a *AzureBlob) Validate(isBackup bool) error

Validate internal validation for struct params.

type Backup

type Backup struct {
	Common
	MaxRetries          int
	OutputFile          string
	RemoveFiles         bool
	ModifiedBefore      string
	ModifiedAfter       string
	FileLimit           uint64
	AfterDigest         string
	MaxRecords          int64
	NoBins              bool
	SleepBetweenRetries int
	FilterExpression    string
	RemoveArtifacts     bool
	Compact             bool
	NodeList            string
	NoTTLOnly           bool
	PreferRacks         string
	PartitionList       string
	Estimate            bool
	EstimateSamples     int64
	StateFileDst        string
	Continue            string
	ScanPageSize        int64
	OutputFilePrefix    string
	RackList            string
}

Backup flags that will be mapped to (scan) backup config. (common for backup and restore flags are in Common).

func (*Backup) Bins added in v1.1.0

func (b *Backup) Bins() []string

Bins maps the BinList string into a slice of bin names by splitting it using commas. Returns nil if empty.

func (*Backup) InfoPolicy added in v1.1.0

func (b *Backup) InfoPolicy() *aerospike.InfoPolicy

InfoPolicy maps the backup configuration into an Aerospike InfoPolicy.

func (*Backup) ModifiedAfterTime added in v1.1.0

func (b *Backup) ModifiedAfterTime() (time.Time, error)

ModifiedAfterTime maps the ModifiedAfter string into a UTC time.

func (*Backup) ModifiedBeforeTime added in v1.1.0

func (b *Backup) ModifiedBeforeTime() (time.Time, error)

ModifiedBeforeTime maps the ModifiedBefore string into a UTC time.

func (*Backup) Nodes added in v1.1.0

func (b *Backup) Nodes() []string

Nodes maps the NodeList string into a slice of node names by splitting it using commas. Returns nil if empty.

func (*Backup) PartitionFilters added in v1.1.0

func (b *Backup) PartitionFilters() ([]*aerospike.PartitionFilter, error)

PartitionFilters map backup config to partition filters.

func (*Backup) Racks added in v1.1.0

func (b *Backup) Racks() ([]int, error)

Racks 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 (*Backup) RetryPolicy added in v1.1.0

func (b *Backup) RetryPolicy() *models.RetryPolicy

RetryPolicy maps backup configuration parameters to a retry policy, including interval, multiplier, and max retries.

func (*Backup) ScanPolicy added in v1.1.0

func (b *Backup) ScanPolicy() (*aerospike.ScanPolicy, error)

ScanPolicy map backup config to scan policy.

func (*Backup) Sets added in v1.1.0

func (b *Backup) Sets() []string

Sets maps the Sets string into a slice of set names by splitting it using commas. Returns nil if empty.

func (*Backup) ShouldClearTarget

func (b *Backup) ShouldClearTarget() bool

ShouldClearTarget check if we should clean target directory.

func (*Backup) ShouldSaveState

func (b *Backup) ShouldSaveState() bool

func (*Backup) Validate

func (b *Backup) Validate() error

type BackupListFilter added in v1.1.0

type BackupListFilter struct {
	// Name is an optional backup routine name. If empty, backups for all routines are returned.
	Name string

	// From is an optional lower-bound timestamp filter (Unix milliseconds).
	From int64

	// To is an optional upper-bound timestamp filter (Unix milliseconds).
	To int64
}

BackupListFilter holds filters for listing full or incremental backups. All fields are optional.

type BackupRoutine added in v1.1.0

type BackupRoutine struct {
	Name string
}

BackupRoutine identifies a backup routine by name. Used by cancel and status commands.

func (*BackupRoutine) Validate added in v1.1.0

func (b *BackupRoutine) Validate() error

type BackupTrigger added in v1.1.0

type BackupTrigger struct {
	// Name is the backup routine name to trigger.
	Name string

	// Delay is the optional delay before the backup starts, in milliseconds.
	Delay int
}

BackupTrigger holds inputs for triggering full or incremental backups.

func (*BackupTrigger) Validate added in v1.1.0

func (b *BackupTrigger) Validate() error

type BackupXDR

type BackupXDR struct {
	Directory                    string
	FileLimit                    uint64
	RemoveFiles                  bool
	ParallelWrite                int
	DC                           string
	LocalAddress                 string
	LocalPort                    int
	Namespace                    string
	Rewind                       string
	MaxThroughput                int
	ReadTimeoutMilliseconds      int64
	WriteTimeoutMilliseconds     int64
	ResultQueueSize              int
	AckQueueSize                 int
	MaxConnections               int
	InfoPolingPeriodMilliseconds int64
	StartTimeoutMilliseconds     int64
	InfoTimeout                  int64

	StopXDR    bool
	UnblockMRT bool

	InfoMaxRetries                uint
	InfoRetriesMultiplier         float64
	InfoRetryIntervalMilliseconds int64

	Forward bool
}

BackupXDR flags that will be mapped to xdr backup config.

func (*BackupXDR) InfoPolicy added in v1.1.0

func (b *BackupXDR) InfoPolicy() *aerospike.InfoPolicy

InfoPolicy maps the backup configuration into an Aerospike InfoPolicy.

func (*BackupXDR) RetryPolicy added in v1.1.0

func (b *BackupXDR) RetryPolicy() *models.RetryPolicy

RetryPolicy maps backup configuration parameters to a retry policy, including interval, multiplier, and max retries.

func (*BackupXDR) Validate

func (b *BackupXDR) Validate() error

type ClientPolicy

type ClientPolicy struct {
	Timeout      int64
	IdleTimeout  int64
	LoginTimeout int64
}

ClientPolicy contains flags that will be mapped to ClientPolicy.

type Common

type Common struct {
	Directory        string
	Namespace        string
	SetList          string
	BinList          string
	Parallel         int
	NoRecords        bool
	NoIndexes        bool
	NoUDFs           bool
	RecordsPerSecond int
	TotalTimeout     int64
	SocketTimeout    int64
	InfoTimeout      int64

	InfoMaxRetries                uint
	InfoRetriesMultiplier         float64
	InfoRetryIntervalMilliseconds int64

	// Bandwidth is mapped to config.Bandwidth
	// Is set in MiB then converted to bytes.
	Bandwidth int64
	// Buffer size for stdin/stdout operations.
	StdBufferSize int
}

Common parameters are used by both backup and restore operations.

func (*Common) Validate

func (c *Common) Validate() error

type Compression

type Compression struct {
	Mode  string
	Level int
}

Compression contains flags that will be mapped to CompressionPolicy for backup and restore operations.

func (*Compression) Policy added in v1.1.0

func (c *Compression) Policy() *backup.CompressionPolicy

Policy converts Compression to backup.CompressionPolicy.

func (*Compression) Validate added in v1.1.0

func (c *Compression) Validate() error

type ConfigClusterFields added in v1.1.0

type ConfigClusterFields struct {
	// Name is the cluster name (URL path parameter).
	Name string

	// SeedNodes is a list of seed-node entries in the form host:port[/tls-name].
	// Repeatable flag (--seed-node host:port).
	SeedNodes []string

	// PreferRacks is the list of acceptable racks in order of preference.
	PreferRacks []int

	ConnTimeout          int
	Label                string
	MaxParallelScans     int
	UseServicesAlternate bool

	// Credentials.* override fields under the credential object.
	CredentialsUser            string
	CredentialsPassword        string
	CredentialsPasswordPath    string
	CredentialsAuthMode        string
	CredentialsSecretAgentName string

	// TLS.* override fields under the tls object.
	TLSCaFile          string
	TLSCaPath          string
	TLSCertFile        string
	TLSCipherSuite     string
	TLSKeyFile         string
	TLSKeyFilePassword string
	TLSName            string
	TLSProtocols       string
}

ConfigClusterFields holds CLI inputs for adding or updating a single Aerospike cluster definition (DtoAerospikeCluster).

func (*ConfigClusterFields) Validate added in v1.1.0

func (c *ConfigClusterFields) Validate() error

Validate checks the bare minimum required by the CLI itself. Server-side validation of the request body (e.g. seed-nodes presence) is deferred to the API.

type ConfigPolicyFields added in v1.1.0

type ConfigPolicyFields struct {
	// Name is the policy name (URL path parameter).
	Name string

	Bandwidth                int
	FileLimit                int
	MaxConcurrentNodes       int
	Parallel                 int
	ParallelWrite            int
	RecordsPerSecond         int
	SocketTimeout            int
	TotalTimeout             int
	ConcurrentIncremental    bool
	NoIndexes                bool
	NoRecords                bool
	NoUdfs                   bool
	Sealed                   bool
	UseScanCompression       bool
	WithClusterConfiguration bool

	// Compression.* override fields under the compression object.
	CompressionMode  string
	CompressionLevel int

	// Encryption.* override fields under the encryption object.
	EncryptionMode      string
	EncryptionKeyEnv    string
	EncryptionKeyFile   string
	EncryptionKeySecret string

	// Retention.* override fields under the retention object.
	RetentionFull        int
	RetentionIncremental int

	// Retry.* override fields under the retry-policy object.
	RetryBaseTimeout int
	RetryMaxRetries  int
	RetryMultiplier  float32
}

ConfigPolicyFields holds CLI inputs for adding or updating a single backup policy (DtoBackupPolicy). See ConfigClusterFields for the override semantics when File is combined with individual flags.

func (*ConfigPolicyFields) Validate added in v1.1.0

func (c *ConfigPolicyFields) Validate() error

Validate checks the bare minimum required by the CLI itself.

type ConfigResourceName added in v1.1.0

type ConfigResourceName struct {
	Name string
}

ConfigResourceName identifies a named configuration resource (cluster, policy, routine or storage). Used by show/delete/enable/disable commands.

func (*ConfigResourceName) Validate added in v1.1.0

func (c *ConfigResourceName) Validate() error

type ConfigRoutineFields added in v1.1.0

type ConfigRoutineFields struct {
	// Name is the routine name (URL path parameter).
	Name string

	BackupPolicy     string
	SourceCluster    string
	Storage          string
	SecretAgent      string
	IntervalCron     string
	IncrIntervalCron string
	PartitionList    string
	Disabled         bool

	Namespaces []string
	BinList    []string
	SetList    []string
	NodeList   []string
	RackList   []int
}

ConfigRoutineFields holds CLI inputs for adding or updating a single backup routine (DtoBackupRoutine). See ConfigClusterFields for the override semantics when File is combined with individual flags.

func (*ConfigRoutineFields) Validate added in v1.1.0

func (c *ConfigRoutineFields) Validate() error

Validate checks the bare minimum required by the CLI itself.

type ConfigStorageFields added in v1.1.0

type ConfigStorageFields struct {
	// Name is the storage name (URL path parameter).
	Name string

	// LocalStorage.*
	LocalPath        string
	LocalMinPartSize int

	// S3Storage.*
	S3Bucket              string
	S3Region              string
	S3AccessKeyID         string
	S3SecretAccessKey     string
	S3Path                string
	S3EndpointOverride    string
	S3Profile             string
	S3LogLevel            string
	S3MinPartSize         int
	S3MaxAsyncConnections int
	S3SecretAgentName     string

	// GcpStorage.*
	GcpBucketName       string
	GcpKey              string
	GcpKeyFilePath      string
	GcpEndpoint         string
	GcpPath             string
	GcpMinPartSize      int
	GcpSecretAgentName  string
	GcpStorageClassData string

	// AzureStorage.*
	AzureAccountName      string
	AzureAccountKey       string
	AzureClientID         string
	AzureClientSecret     string
	AzureContainerName    string
	AzureEndpoint         string
	AzureTenantID         string
	AzurePath             string
	AzureMinPartSize      int
	AzureSecretAgentName  string
	AzureStorageClassData string
	AzureStorageClassMeta string
}

ConfigStorageFields holds CLI inputs for adding or updating a single backup storage definition (DtoStorage). Storage is a wrapper around exactly one of local/s3/gcp/azure provider sub-objects; populating any field of a provider group implicitly selects that provider.

See ConfigClusterFields for the override semantics when File is combined with individual flags.

func (*ConfigStorageFields) Validate added in v1.1.0

func (c *ConfigStorageFields) Validate() error

Validate checks the bare minimum required by the CLI itself.

type ConfigUpdate added in v1.1.0

type ConfigUpdate struct {
	// File is a path to a YAML file with the full DtoConfig body.
	File string
}

ConfigUpdate holds inputs for replacing the full service configuration in a single PUT request.

func (*ConfigUpdate) Validate added in v1.1.0

func (c *ConfigUpdate) Validate() error

type Encryption

type Encryption struct {
	Mode      string
	KeyFile   string
	KeyEnv    string
	KeySecret string
}

Encryption contains flags that will be mapped to EncryptionPolicy for backup and restore operations.

func (*Encryption) Policy added in v1.1.0

func (e *Encryption) Policy() *backup.EncryptionPolicy

Policy converts Encryption to backup.EncryptionPolicy.

func (*Encryption) Validate added in v1.1.0

func (e *Encryption) Validate() error

type GcpStorage

type GcpStorage struct {
	// Path to file containing Service Account JSON Key.
	KeyFile string
	// For GPC storage bucket is not part of the path as in S3.
	// So we should set it separately.
	BucketName string
	// Alternative url.
	// It is not recommended to use an alternate URL in a production environment.
	Endpoint string

	RetryMaxAttempts       int
	RetryBackoffMax        int
	RetryBackoffInit       int
	RetryBackoffMultiplier float64

	ChunkSize int

	StorageCommon
}

GcpStorage represents the configuration for GCP storage integration.

func (*GcpStorage) IsConfigured added in v1.1.0

func (g *GcpStorage) IsConfigured() bool

func (*GcpStorage) Validate

func (g *GcpStorage) Validate(isBackup bool) error

Validate internal validation for struct params.

type Local

type Local struct {
	BufferSize int
}

Local represents local storage.

func (*Local) Validate

func (l *Local) Validate(isBackup bool) error

type Metadata added in v1.1.0

type Metadata struct {
	BackupID      string `json:"backup_id"`
	Namespace     string `json:"namespace"`
	FormatVersion int    `json:"format_version"`
	Nodes         []Node `json:"nodes"`
}

Metadata is the metadata for a backup.

type Node added in v1.1.0

type Node struct {
	NodeID         string    `json:"node_id"`
	Created        time.Time `json:"created"`
	Finished       time.Time `json:"finished"`
	RecordCount    int64     `json:"record_count"`
	ByteCount      int64     `json:"byte_count"`
	PartitionCount int       `json:"partition_count"`
	SegmentCount   int       `json:"segment_count"`
}

Node is the metadata for a node.

type Restore

type Restore struct {
	Common

	InputFile          string
	DirectoryList      string
	ParentDirectory    string
	DisableBatchWrites bool
	BatchSize          int
	MaxAsyncBatches    int
	// For optimal performance, should be at least MaxAsyncBatches.
	// This is applicable only to batch writes.
	WarmUp            int
	ExtraTTL          int64
	IgnoreRecordError bool
	Uniq              bool
	Replace           bool
	NoGeneration      bool

	RetryBaseInterval int64
	RetryMultiplier   float64
	RetryMaxAttempts  uint

	Mode string

	ValidateOnly      bool
	ApplyMetadataLast bool
}

Restore contains flags that will be mapped to restore config.

func (*Restore) Bins added in v1.1.0

func (r *Restore) Bins() []string

Bins converts the BinList string into a slice of bin names by splitting it using commas. Returns nil if empty.

func (*Restore) InfoPolicy added in v1.1.0

func (r *Restore) InfoPolicy() *aerospike.InfoPolicy

InfoPolicy maps the restore configuration into an Aerospike InfoPolicy.

func (*Restore) IsDirectoryRestore

func (r *Restore) IsDirectoryRestore() bool

func (*Restore) NamespaceConfig added in v1.1.0

func (r *Restore) NamespaceConfig() *backup.RestoreNamespaceConfig

NamespaceConfig creates and returns a RestoreNamespaceConfig with source and destination namespaces derived from input. Took value from r.Namespace. If one namespace is provided, it sets both source and destination to the same value. Returns nil if invalid input (e.g., more than two namespaces) is provided.

func (*Restore) RetryPolicy added in v1.1.0

func (r *Restore) RetryPolicy() *models.RetryPolicy

RetryPolicy maps restore configuration parameters to a retry policy, including interval, multiplier, and max retries.

func (*Restore) Sets added in v1.1.0

func (r *Restore) Sets() []string

Sets converts the Sets string into a slice of set names by splitting it using commas. Returns nil if empty.

func (*Restore) Validate

func (r *Restore) Validate() error

func (*Restore) WritePolicy added in v1.1.0

func (r *Restore) WritePolicy() *aerospike.WritePolicy

WritePolicy map restore config to write policy.

type RestoreJobID added in v1.1.0

type RestoreJobID struct {
	JobID int64
}

RestoreJobID identifies a single restore job by ID.

func (*RestoreJobID) Validate added in v1.1.0

func (r *RestoreJobID) Validate() error

type RestoreJobsFilter added in v1.1.0

type RestoreJobsFilter struct {
	From   int64
	To     int64
	Status string
}

RestoreJobsFilter holds filters for listing restore jobs.

type RestoreRequest added in v1.1.0

type RestoreRequest struct {
	// BackupDataPath is the path to the backup data inside the storage root.
	BackupDataPath string

	// DestinationName references a preconfigured destination cluster by name.
	DestinationName string

	// SourceName references a preconfigured storage source by name.
	SourceName string

	// SecretAgentName references a preconfigured secret agent by name.
	SecretAgentName string
}

RestoreRequest holds inputs for full/incremental restore operations. Either RequestFile or BackupDataPath must be set. Flag values override fields loaded from RequestFile when both are provided.

func (*RestoreRequest) Validate added in v1.1.0

func (r *RestoreRequest) Validate() error

type RestoreTimestampRequest added in v1.1.0

type RestoreTimestampRequest struct {
	// Routine is the backup routine name to restore from.
	Routine string

	// Time is the epoch time in milliseconds for point-in-time recovery.
	Time int64

	// DestinationName references a preconfigured destination cluster by name.
	DestinationName string

	// SecretAgentName references a preconfigured secret agent by name.
	SecretAgentName string

	// DisableReordering disables the reverse order of incremental backups optimization.
	DisableReordering bool
}

RestoreTimestampRequest holds inputs for the timestamp-based restore operation. Either RequestFile or both Routine and Time must be set.

func (*RestoreTimestampRequest) Validate added in v1.1.0

func (r *RestoreTimestampRequest) Validate() error

type Root

type Root struct {
	Help    bool
	Version bool
}

Root contains the global application flags.

type SecretAgent

type SecretAgent struct {
	ConnectionType     string
	Address            string
	Port               int
	TimeoutMillisecond int

	CaFile   string
	TLSName  string
	CertFile string
	KeyFile  string

	IsBase64 bool
}

SecretAgent contains flags that will be mapped to SecretAgentConfig for backup and restore operations.

func (*SecretAgent) Config added in v1.1.0

func (s *SecretAgent) Config() *backup.SecretAgentConfig

Config returns SecretAgentConfig for backup and restore operations.

func (*SecretAgent) Validate

func (s *SecretAgent) Validate() error

Validate checks if SecretAgent params are valid.

type ServerBackup added in v1.1.0

type ServerBackup struct {
	ListPath    string
	Namespace   string
	JobID       string
	StorageType string
}

ServerBackup contains flags that will be mapped to ServerBackup.

type ServiceConnection added in v1.1.0

type ServiceConnection struct {
	Host string
	Port int
}

ServiceConnection holds the connection parameters for the ABS REST API.

func (*ServiceConnection) ServerURL added in v1.1.0

func (s *ServiceConnection) ServerURL() string

func (*ServiceConnection) Validate added in v1.1.0

func (s *ServiceConnection) Validate() error

type StorageCommon

type StorageCommon struct {
	MaxConnsPerHost int
	RequestTimeout  int

	CalculateChecksum bool

	RetryReadBackoff     int
	RetryReadMultiplier  float64
	RetryReadMaxAttempts uint
}

func (*StorageCommon) Validate

func (s *StorageCommon) Validate(isBackup bool) error

Jump to

Keyboard shortcuts

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