Documentation
¶
Index ¶
- Constants
- func LogFaultErrors(ctx context.Context, fe *fault.Errors, prefix string)
- type BackupOperation
- type BackupResults
- type ExportOperation
- type MaintenanceOperation
- type MaintenanceResults
- type OpStatus
- type PersistentConfigOperation
- type PersistentConfigResults
- type RestoreOperation
- type RestoreResults
- type RetentionConfigOperation
- type RetentionConfigResults
Constants ¶
const ( // CopyBufferSize is the size of the copy buffer for disk // write operations CopyBufferSize = 5 * 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackupOperation ¶
type BackupOperation struct {
ResourceOwner idname.Provider
Results BackupResults `json:"results"`
Selectors selectors.Selector `json:"selectors"`
Version string `json:"version"`
// BackupVersion ONLY controls the value that gets persisted to the
// backup model after operation. It does NOT modify the operation behavior
// to match the version. Its inclusion here is, unfortunately, purely to
// facilitate integration testing that requires a certain backup version, and
// should be removed when we have a more controlled workaround.
BackupVersion int
// AdditionalTags holds caller-supplied tags (pkg/engine's Backup is the
// only promoted caller today) to persist on the resulting backup model
// alongside the fork's own bookkeeping tags (model.ServiceTag,
// model.BackupTypeTag). persistResults below merges these in without
// ever letting one override a key the fork itself already set: those
// two tags drive merge/assist/preview base-selection logic elsewhere,
// so a caller-controlled value colliding with them must never take
// effect, even if some future caller bypasses pkg/engine's own
// reserved-key validation and sets this field directly.
AdditionalTags map[string]string
// contains filtered or unexported fields
}
BackupOperation wraps an operation with backup-specific props.
func NewBackupOperation ¶
func NewBackupOperation( ctx context.Context, opts control.Options, kw *kopia.Wrapper, sw store.BackupStorer, bp inject.BackupProducer, acct account.Account, selector selectors.Selector, owner idname.Provider, counter *count.Bus, ) (BackupOperation, error)
NewBackupOperation constructs and validates a backup operation.
type BackupResults ¶
type BackupResults struct {
stats.ReadWrites
stats.StartAndEndTime
BackupID model.StableID `json:"backupID"`
// keys are found in /pkg/count/keys.go
Counts map[string]int64 `json:"counts"`
}
BackupResults aggregate the details of the result of the operation.
type ExportOperation ¶
type ExportOperation struct {
BackupID model.StableID
Results RestoreResults
Selectors selectors.Selector
ExportCfg control.ExportConfig
Version string
// contains filtered or unexported fields
}
ExportOperation wraps an operation with export-specific props.
func NewExportOperation ¶
func NewExportOperation( ctx context.Context, opts control.Options, kw *kopia.Wrapper, sw store.BackupStorer, ec inject.ExportConsumer, acct account.Account, backupID model.StableID, sel selectors.Selector, exportCfg control.ExportConfig, ) (ExportOperation, error)
NewExportOperation constructs and validates a export operation.
func (*ExportOperation) GetStats ¶
func (op *ExportOperation) GetStats() map[path.CategoryType]metrics.KindStats
GetStats returns the stats of the export operation. You should only be calling this once the export collections have been read and process as the data that will be available here will be the data that was read and processed.
func (*ExportOperation) Run ¶
func (op *ExportOperation) Run(ctx context.Context) ( expColl []export.Collectioner, err error, )
Run begins a synchronous export operation.
type MaintenanceOperation ¶
type MaintenanceOperation struct {
Results MaintenanceResults
// contains filtered or unexported fields
}
MaintenanceOperation wraps an operation with restore-specific props.
func NewMaintenanceOperation ¶
func NewMaintenanceOperation( ctx context.Context, opts control.Options, kw *kopia.Wrapper, storer store.BackupStorer, mOpts repository.Maintenance, ) (MaintenanceOperation, error)
NewMaintenanceOperation constructs and validates a maintenance operation.
type MaintenanceResults ¶
type MaintenanceResults struct {
stats.StartAndEndTime
}
MaintenanceResults aggregate the details of the results of the operation.
type OpStatus ¶
type OpStatus int
OpStatus describes the current status of an operation. InProgress - the standard value for any process that has not arrived at an end state. The end states are Failed, Completed, or NoData.
Failed - the operation was unable to begin processing data at all. No items have been written by the consumer.
Completed - the operation was able to process one or more of the items in the request. Both partial success (0 < N < len(items) errored) and total success (0 errors) are set as Completed.
NoData - only occurs when no data was involved in an operation. For example, if a backup is requested for a specific user's mail, but that account contains zero mail messages, the backup contains No Data.
type PersistentConfigOperation ¶
type PersistentConfigOperation struct {
Results PersistentConfigResults
// contains filtered or unexported fields
}
PersistentConfig wraps an operation that deals with repo configuration.
func NewPersistentConfigOperation ¶
func NewPersistentConfigOperation( ctx context.Context, opts control.Options, kw *kopia.Wrapper, configOpts repository.PersistentConfig, ) (PersistentConfigOperation, error)
NewPersistentConfigOperation constructs and validates an operation to change various persistent config parameters like the minimum epoch duration for the kopia index.
type PersistentConfigResults ¶
type PersistentConfigResults struct {
stats.StartAndEndTime
}
PersistentConfigResults aggregate the details of the results of the operation.
type RestoreOperation ¶
type RestoreOperation struct {
BackupID model.StableID
Results RestoreResults
Selectors selectors.Selector
RestoreCfg control.RestoreConfig
Version string
// contains filtered or unexported fields
}
RestoreOperation wraps an operation with restore-specific props.
func NewRestoreOperation ¶
func NewRestoreOperation( ctx context.Context, opts control.Options, kw *kopia.Wrapper, sw store.BackupStorer, rc inject.RestoreConsumer, acct account.Account, backupID model.StableID, sel selectors.Selector, restoreCfg control.RestoreConfig, ctr *count.Bus, ) (RestoreOperation, error)
NewRestoreOperation constructs and validates a restore operation.
type RestoreResults ¶
type RestoreResults struct {
stats.ReadWrites
stats.StartAndEndTime
}
RestoreResults aggregate the details of the results of the operation.
type RetentionConfigOperation ¶
type RetentionConfigOperation struct {
Results RetentionConfigResults
// contains filtered or unexported fields
}
RetentionConfigOperation wraps an operation with restore-specific props.
func NewRetentionConfigOperation ¶
func NewRetentionConfigOperation( ctx context.Context, opts control.Options, kw *kopia.Wrapper, rcOpts repository.Retention, ) (RetentionConfigOperation, error)
NewRetentionConfigOperation constructs and validates an operation to change retention parameters.
type RetentionConfigResults ¶
type RetentionConfigResults struct {
stats.StartAndEndTime
}
RetentionConfigResults aggregate the details of the results of the operation.