dto

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Verbose  *bool   `yaml:"verbose"`
	LogLevel *string `yaml:"log-level"`
	LogJSON  *bool   `yaml:"log-json"`
	LogFile  *string `yaml:"log-file"`
}

App represents the application-level configuration parsed from a YAML file.

func (*App) ToModelApp

func (a *App) ToModelApp() *models.App

type AwsS3

type AwsS3 struct {
	BucketName           *string  `yaml:"bucket-name"`
	Region               *string  `yaml:"region"`
	Profile              *string  `yaml:"profile"`
	EndpointOverride     *string  `yaml:"endpoint-override"`
	AccessKeyID          *string  `yaml:"access-key-id"`
	SecretAccessKey      *string  `yaml:"secret-access-key"`
	RestorePollDuration  *int64   `yaml:"restore-poll-duration"`
	StorageClass         *string  `yaml:"storage-class"`
	AccessTier           *string  `yaml:"tier"`
	RetryMaxAttempts     *int     `yaml:"retry-max-attempts"`
	RetryMaxBackoff      *int     `yaml:"retry-max-backoff"`
	ChunkSize            *int     `yaml:"chunk-size"`
	UploadConcurrency    *int     `yaml:"upload-concurrency"`
	CalculateChecksum    *bool    `yaml:"calculate-checksum"`
	RetryReadBackoff     *int     `yaml:"retry-read-backoff"`
	RetryReadMultiplier  *float64 `yaml:"retry-read-multiplier"`
	RetryReadMaxAttempts *uint    `yaml:"retry-read-max-attempts"`
	MaxConnsPerHost      *int     `yaml:"max-conns-per-host"`
	RequestTimeout       *int     `yaml:"request-timeout"`
}

AwsS3 defines configuration for AWS S3 storage including bucket details and retry mechanisms parsed from a YAML file.

func (*AwsS3) ToModelAwsS3

func (a *AwsS3) ToModelAwsS3() *models.AwsS3

type AzureBlob

type AzureBlob struct {
	AccountName          *string  `yaml:"account-name"`
	AccountKey           *string  `yaml:"account-key"`
	TenantID             *string  `yaml:"tenant-id"`
	ClientID             *string  `yaml:"client-id"`
	ClientSecret         *string  `yaml:"client-secret"` // #nosec G117
	EndpointOverride     *string  `yaml:"endpoint"`
	ContainerName        *string  `yaml:"container-name"`
	AccessTier           *string  `yaml:"access-tier"`
	RestorePollDuration  *int64   `yaml:"rehydrate-poll-duration"`
	RetryMaxAttempts     *int     `yaml:"retry-max-attempts"`
	RetryDelay           *int     `yaml:"retry-delay"`
	RetryMaxDelay        *int     `yaml:"retry-max-delay"`
	UploadConcurrency    *int     `yaml:"upload-concurrency"`
	CalculateChecksum    *bool    `yaml:"calculate-checksum"`
	RetryReadBackoff     *int     `yaml:"retry-read-backoff"`
	RetryReadMultiplier  *float64 `yaml:"retry-read-multiplier"`
	RetryReadMaxAttempts *uint    `yaml:"retry-read-max-attempts"`
	MaxConnsPerHost      *int     `yaml:"max-conns-per-host"`
	RequestTimeout       *int     `yaml:"request-timeout"`
	BlockSize            *int     `yaml:"block-size"`
}

func (*AzureBlob) ToModelAzureBlob

func (a *AzureBlob) ToModelAzureBlob() *models.AzureBlob

type Backup

type Backup struct {
	App         App          `yaml:"app"`
	Cluster     Cluster      `yaml:"cluster"`
	Backup      BackupConfig `yaml:"backup"`
	Compression Compression  `yaml:"compression"`
	Encryption  Encryption   `yaml:"encryption"`
	SecretAgent SecretAgent  `yaml:"secret-agent"`
	Aws         struct {
		S3 AwsS3 `yaml:"s3"`
	} `yaml:"aws"`
	Gcp struct {
		Storage GcpStorage `yaml:"storage"`
	} `yaml:"gcp"`
	Azure struct {
		Blob AzureBlob `yaml:"blob"`
	} `yaml:"azure"`
	Local struct {
		Disk Local `yaml:"disk"`
	} `yaml:"local"`
}

Backup is used to map yaml config.

func DefaultBackup

func DefaultBackup() *Backup

DefaultBackup returns a Backup with default values.

func (*Backup) LoadSecrets added in v1.1.0

func (b *Backup) LoadSecrets(ctx context.Context) error

LoadSecrets resolves any secrets: prefixed values in the Backup DTO using the configured secret agent. Must be called before DTO-to-model conversion so that CertFlag.Set() receives file paths or raw content, not secret references.

func (*Backup) ToModelBackup

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

type BackupConfig

type BackupConfig struct {
	Directory                     *string  `yaml:"directory"`
	Namespace                     *string  `yaml:"namespace"`
	SetList                       []string `yaml:"set-list"`
	BinList                       []string `yaml:"bin-list"`
	Parallel                      *int     `yaml:"parallel"`
	NoRecords                     *bool    `yaml:"no-records"`
	NoIndexes                     *bool    `yaml:"no-indexes"`
	NoUDFs                        *bool    `yaml:"no-udfs"`
	RecordsPerSecond              *int     `yaml:"records-per-second"`
	MaxRetries                    *int     `yaml:"max-retries"`
	TotalTimeout                  *int64   `yaml:"total-timeout"`
	SocketTimeout                 *int64   `yaml:"socket-timeout"`
	Bandwidth                     *int64   `yaml:"bandwidth"`
	OutputFile                    *string  `yaml:"output-file"`
	RemoveFiles                   *bool    `yaml:"remove-files"`
	ModifiedBefore                *string  `yaml:"modified-before"`
	ModifiedAfter                 *string  `yaml:"modified-after"`
	FileLimit                     *uint64  `yaml:"file-limit"`
	AfterDigest                   *string  `yaml:"after-digest"`
	MaxRecords                    *int64   `yaml:"max-records"`
	NoBins                        *bool    `yaml:"no-bins"`
	SleepBetweenRetries           *int     `yaml:"sleep-between-retries"`
	FilterExpression              *string  `yaml:"filter-exp"`
	RemoveArtifacts               *bool    `yaml:"remove-artifacts"`
	Compact                       *bool    `yaml:"compact"`
	NodeList                      []string `yaml:"node-list"`
	NoTTLOnly                     *bool    `yaml:"no-ttl-only"`
	PreferRacks                   []string `yaml:"prefer-racks"`
	PartitionList                 []string `yaml:"partition-list"`
	Estimate                      *bool    `yaml:"estimate"`
	EstimateSamples               *int64   `yaml:"estimate-samples"`
	StateFileDst                  *string  `yaml:"state-file-dst"`
	Continue                      *string  `yaml:"continue"`
	ScanPageSize                  *int64   `yaml:"scan-page-size"`
	OutputFilePrefix              *string  `yaml:"output-file-prefix"`
	RackList                      []string `yaml:"rack-list"`
	InfoTimeout                   *int64   `yaml:"info-timeout"`
	InfoMaxRetries                *uint    `yaml:"info-max-retries"`
	InfoRetriesMultiplier         *float64 `yaml:"info-retry-multiplier"`
	InfoRetryIntervalMilliseconds *int64   `yaml:"info-retry-interval"`
	StdBufferSize                 *int     `yaml:"std-buffer"`
}

type Cluster

type Cluster struct {
	Seeds              []ClusterSeed `yaml:"seeds"`
	User               *string       `yaml:"user"`
	Password           *string       `yaml:"password"` // #nosec G117
	Auth               *string       `yaml:"auth"`
	ClientTimeout      *int64        `yaml:"client-timeout"`
	ClientIdleTimeout  *int64        `yaml:"client-idle-timeout"`
	ClientLoginTimeout *int64        `yaml:"client-login-timeout"`
	ServiceAlternate   *bool         `yaml:"services-alternate"`
	TLS                *ClusterTLS   `yaml:"tls"`
}

Cluster defines the configuration for connecting to an Aerospike cluster, including seeds, auth, and TLS settings parsed from a YAML file.

func (*Cluster) ToAerospikeConfig

func (c *Cluster) ToAerospikeConfig() (*client.AerospikeConfig, error)

func (*Cluster) ToModelClientPolicy

func (c *Cluster) ToModelClientPolicy() *models.ClientPolicy

type ClusterSeed

type ClusterSeed struct {
	Host    *string `yaml:"host"`
	TLSName *string `yaml:"tls-name"`
	Port    *int    `yaml:"port"`
}

type ClusterTLS

type ClusterTLS struct {
	Enable          *bool   `yaml:"enable"`
	Protocols       *string `yaml:"protocols"`
	CaFile          *string `yaml:"cafile"`
	CaPath          *string `yaml:"capath"`
	CertFile        *string `yaml:"certfile"`
	KeyFile         *string `yaml:"keyfile"`
	KeyFilePassword *string `yaml:"keyfile-password"`
}

type Compression

type Compression struct {
	Mode  *string `yaml:"compress"`
	Level *int    `yaml:"level"`
}

Compression represents the configuration for data compression, including the mode and compression level parsed from a YAML file.

func (*Compression) ToModelCompression

func (c *Compression) ToModelCompression() *models.Compression

type Encryption

type Encryption struct {
	Mode      *string `yaml:"encrypt"`
	KeyFile   *string `yaml:"key-file"`
	KeyEnv    *string `yaml:"key-env"`
	KeySecret *string `yaml:"key-secret"`
}

Encryption defines encryption configuration options parsed from a YAML file. It includes fields for mode, key file, key environment variable, and key secret parsed from a YAML file.

func (*Encryption) ToModelEncryption

func (e *Encryption) ToModelEncryption() *models.Encryption

type GcpStorage

type GcpStorage struct {
	KeyFile                *string  `yaml:"key-path"`
	BucketName             *string  `yaml:"bucket-name"`
	EndpointOverride       *string  `yaml:"endpoint-override"`
	RetryMaxAttempts       *int     `yaml:"retry-max-attempts"`
	RetryMaxBackoff        *int     `yaml:"retry-max-backoff"`
	RetryInitBackoff       *int     `yaml:"retry-init-backoff"`
	RetryBackoffMultiplier *float64 `yaml:"retry-backoff-multiplier"`
	ChunkSize              *int     `yaml:"chunk-size"`
	CalculateChecksum      *bool    `yaml:"calculate-checksum"`
	RetryReadBackoff       *int     `yaml:"retry-read-backoff"`
	RetryReadMultiplier    *float64 `yaml:"retry-read-multiplier"`
	RetryReadMaxAttempts   *uint    `yaml:"retry-read-max-attempts"`
	MaxConnsPerHost        *int     `yaml:"max-conns-per-host"`
	RequestTimeout         *int     `yaml:"request-timeout"`
}

func (*GcpStorage) ToModelGcpStorage

func (g *GcpStorage) ToModelGcpStorage() *models.GcpStorage

type Local

type Local struct {
	BufferSize int `yaml:"buffer-size"`
}

func (*Local) ToModelLocal

func (l *Local) ToModelLocal() *models.Local

type Restore

type Restore struct {
	App         App           `yaml:"app"`
	Cluster     Cluster       `yaml:"cluster"`
	Restore     RestoreConfig `yaml:"restore"`
	Compression Compression   `yaml:"compression"`
	Encryption  Encryption    `yaml:"encryption"`
	SecretAgent SecretAgent   `yaml:"secret-agent"`
	Aws         struct {
		S3 AwsS3 `yaml:"s3"`
	} `yaml:"aws"`
	Gcp struct {
		Storage GcpStorage `yaml:"storage"`
	} `yaml:"gcp"`
	Azure struct {
		Blob AzureBlob `yaml:"blob"`
	} `yaml:"azure"`
}

Restore is used to map yaml config.

func DefaultRestore

func DefaultRestore() *Restore

DefaultRestore returns a Restore with default values.

func (*Restore) LoadSecrets added in v1.1.0

func (r *Restore) LoadSecrets(ctx context.Context) error

LoadSecrets resolves any secrets: prefixed values in the Restore DTO using the configured secret agent. Must be called before DTO-to-model conversion so that CertFlag.Set() receives file paths or raw content, not secret references.

func (*Restore) ToModelRestore

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

type RestoreConfig

type RestoreConfig struct {
	Directory                     *string  `yaml:"directory"`
	Namespace                     *string  `yaml:"namespace"`
	SetList                       []string `yaml:"set-list"`
	BinList                       []string `yaml:"bin-list"`
	Parallel                      *int     `yaml:"parallel"`
	NoRecords                     *bool    `yaml:"no-records"`
	NoIndexes                     *bool    `yaml:"no-indexes"`
	NoUDFs                        *bool    `yaml:"no-udfs"`
	RecordsPerSecond              *int     `yaml:"records-per-second"`
	TotalTimeout                  *int64   `yaml:"total-timeout"`
	SocketTimeout                 *int64   `yaml:"socket-timeout"`
	Bandwidth                     *int64   `yaml:"bandwidth"`
	InputFile                     *string  `yaml:"input-file"`
	DirectoryList                 []string `yaml:"directory-list"`
	ParentDirectory               *string  `yaml:"parent-directory"`
	DisableBatchWrites            *bool    `yaml:"disable-batch-writes"`
	BatchSize                     *int     `yaml:"batch-size"`
	MaxAsyncBatches               *int     `yaml:"max-async-batches"`
	WarmUp                        *int     `yaml:"warm-up"`
	ExtraTTL                      *int64   `yaml:"extra-ttl"`
	IgnoreRecordError             *bool    `yaml:"ignore-record-error"`
	Uniq                          *bool    `yaml:"unique"`
	Replace                       *bool    `yaml:"replace"`
	NoGeneration                  *bool    `yaml:"no-generation"`
	RetryBaseInterval             *int64   `yaml:"retry-base-interval"`
	RetryMultiplier               *float64 `yaml:"retry-multiplier"`
	RetryMaxAttempts              *uint    `yaml:"retry-max-attempts"`
	ValidateOnly                  *bool    `yaml:"validate"`
	InfoTimeout                   *int64   `yaml:"info-timeout"`
	InfoMaxRetries                *uint    `yaml:"info-max-retries"`
	InfoRetriesMultiplier         *float64 `yaml:"info-retry-multiplier"`
	InfoRetryIntervalMilliseconds *int64   `yaml:"info-retry-interval"`
	ApplyMetadataLast             *bool    `yaml:"apply-metadata-last"`
	StdBufferSize                 *int     `yaml:"std-buffer"`
}

type SecretAgent

type SecretAgent struct {
	ConnectionType     *string `yaml:"connection-type"`
	Address            *string `yaml:"address"`
	Port               *int    `yaml:"port"`
	TimeoutMillisecond *int    `yaml:"timeout"`
	CaFile             *string `yaml:"ca-file"`
	CertFile           *string `yaml:"cert-file"`
	KeyFile            *string `yaml:"key-file"`
	TLSName            *string `yaml:"tls-name"`
	IsBase64           *bool   `yaml:"is-base64"`
}

SecretAgent defines connection properties for a secure agent, including address, port, timeout, and encryption settings parsed from a YAML file.

func (*SecretAgent) ToModelSecretAgent

func (s *SecretAgent) ToModelSecretAgent() *models.SecretAgent

Jump to

Keyboard shortcuts

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