1package out
2
3import (
4 "context"
5 "io"
6 "time"
7
8 "github.com/bnema/gordon/internal/domain"
9)
10
11// DatabaseBackupStorage defines persistence for database backup artifacts and metadata.
12type DatabaseBackupStorage interface {
13 Store(ctx context.Context, app, service, database string, schedule domain.BackupSchedule, timestamp time.Time, data io.Reader) (string, error)
14 Get(ctx context.Context, path string) (io.ReadCloser, error)
15 List(ctx context.Context, app string, schedule *domain.BackupSchedule) ([]domain.DatabaseBackupJob, error)
16 Delete(ctx context.Context, path string) error
17 ApplyRetention(ctx context.Context, app string, policy domain.DatabaseBackupRetentionPolicy) (int, error)
18}
19
20// BackupStorage is kept as a compatibility alias for the existing database backup feature.
21type BackupStorage = DatabaseBackupStorage
22
23// VolumeArchiveExporter exports named container volumes as archive streams.
24type VolumeArchiveExporter interface {
25 ExportVolumeArchive(ctx context.Context, req domain.VolumeArchiveRequest) (*domain.VolumeArchiveResult, error)
26}
27
28// VolumeBackupStorage defines persistence for volume archive backup artifacts.
29type VolumeBackupStorage interface {
30 StoreVolumeArchive(ctx context.Context, job domain.VolumeBackupJob, data io.Reader) (string, error)
31 GetVolumeArchive(ctx context.Context, artifactRef string) (io.ReadCloser, error)
32 ListVolumeArchives(ctx context.Context, domainName string) ([]domain.VolumeBackupJob, error)
33 DeleteVolumeArchive(ctx context.Context, artifactRef string) error
34 ApplyVolumeRetention(ctx context.Context, domainName string, policy domain.VolumeBackupRetentionPolicy) (int, error)
35}