Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicDownload ¶ added in v1.6.0
func AtomicDownload(dest string, expectedSize int64, fn func(io.Writer) (int64, error)) (int64, error)
AtomicDownload writes via fn(w) to dest+".partial" and atomically renames it to dest on success. If expectedSize is non-negative and the bytes written don't match, the partial is removed and an error is returned. On any error path the partial is removed so retention/listing can never see a truncated backup as the latest file.
func Execute ¶
func Execute(ctx context.Context, cfg config.BackupConfig, store *storage.Manager, opts Options) error
Execute runs cfg through its provider with retry/backoff. Every failed attempt is logged to status.json (with Attempt set); the final successful attempt records a success row. A retry.Permanent error from a provider short-circuits the loop. Dry runs skip retry entirely.
Types ¶
type HAProvider ¶
type HAProvider struct{}
type LocalProvider ¶ added in v1.5.0
type LocalProvider struct{}
type Provider ¶
type Provider interface {
Run(ctx context.Context, cfg config.BackupConfig, store *storage.Manager, opts Options) (Result, error)
}
func NewProvider ¶
type Result ¶ added in v1.6.0
Result is what a Provider returns on a successful run. The fields are used by Execute to record the success in status.json.
type SSHProvider ¶
type SSHProvider struct{}