models

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RestoreModeAuto = "auto"
	RestoreModeASB  = "asb"
	RestoreModeASBX = "asbx"
)
View Source
const DefaultChunkSize = 5 * 1024 * 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Help    bool
	Version bool
	Verbose bool
	// Set log level for verbose output.
	LogLevel string
	// Format logs as JSON, for parsing by external tools.
	LogJSON bool
}

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
	RetryMaxBackoffSeconds int
	RetryBackoffSeconds    int

	ChunkSize int
}

AwsS3 represents the configuration for AWS S3 storage integration.

func (*AwsS3) LoadSecrets

func (a *AwsS3) LoadSecrets(cfg *backup.SecretAgentConfig) error

LoadSecrets tries to load field values from secret agent.

func (*AwsS3) Validate

func (a *AwsS3) Validate() 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

	Endpoint      string
	ContainerName string

	AccessTier          string
	RestorePollDuration int64

	RetryMaxAttempts     int
	RetryTimeoutSeconds  int
	RetryDelaySeconds    int
	RetryMaxDelaySeconds int

	BlockSize int
}

AzureBlob represents the configuration for Azure Blob storage integration.

func (*AzureBlob) LoadSecrets

func (a *AzureBlob) LoadSecrets(cfg *backup.SecretAgentConfig) error

LoadSecrets tries to load field values from secret agent.

func (*AzureBlob) Validate

func (a *AzureBlob) Validate() error

Validate internal validation for struct params.

type Backup

type Backup struct {
	OutputFile          string
	RemoveFiles         bool
	ModifiedBefore      string
	ModifiedAfter       string
	FileLimit           uint64
	AfterDigest         string
	MaxRecords          int64
	NoBins              bool
	SleepBetweenRetries int
	FilterExpression    string
	ParallelNodes       bool
	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

	InfoMaxRetries                uint
	InfoRetriesMultiplier         float64
	InfoRetryIntervalMilliseconds int64
}

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

func (*Backup) ShouldClearTarget

func (b *Backup) ShouldClearTarget() bool

ShouldClearTarget check if we should clean target directory.

func (*Backup) ShouldSaveState

func (b *Backup) ShouldSaveState() bool

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

	TLSConfig *tls.Config

	StopXDR    bool
	UnblockMRT bool

	InfoMaxRetries                uint
	InfoRetriesMultiplier         float64
	InfoRetryIntervalMilliseconds int64

	Forward bool
}

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

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
	MaxRetries       int
	TotalTimeout     int64
	SocketTimeout    int64

	// Nice is mapped to config.Bandwidth
	// Is set in MiB then converted to bytes.
	Nice int
}

Common parameters are used by both backup and restore operations.

type Compression

type Compression struct {
	Mode  string
	Level int
}

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

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.

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
	RetryBackoffMaxSeconds  int
	RetryBackoffInitSeconds int
	RetryBackoffMultiplier  float64

	ChunkSize int
}

GcpStorage represents the configuration for GCP storage integration.

func (*GcpStorage) LoadSecrets

func (g *GcpStorage) LoadSecrets(cfg *backup.SecretAgentConfig) error

LoadSecrets tries to load field values from secret agent.

func (*GcpStorage) Validate

func (g *GcpStorage) Validate() error

Validate internal validation for struct params.

type Restore

type Restore struct {
	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
	TimeOut           int64

	RetryBaseTimeout int64
	RetryMultiplier  float64
	RetryMaxRetries  uint

	Mode string

	ValidateOnly bool
}

Restore contains flags that will be mapped to restore config.

func (*Restore) IsDirectoryRestore

func (restore *Restore) IsDirectoryRestore() bool

type SecretAgent

type SecretAgent struct {
	ConnectionType     string
	Address            string
	Port               int
	TimeoutMillisecond int
	CaFile             string
	IsBase64           bool
}

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

Jump to

Keyboard shortcuts

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