SnapshotsRepository 定义快照元数据持久化接口。 负责初始化数据库结构和插入备份记录。 使用场景:存储本地和远程备份的元数据信息,支持历史查询和审计。 默认实现:internal/infrastructure/persistence.SQLiteRepository
| 36 | // 使用场景:存储本地和远程备份的元数据信息,支持历史查询和审计。 |
| 37 | // 默认实现:internal/infrastructure/persistence.SQLiteRepository |
| 38 | type SnapshotsRepository interface { |
| 39 | // InitSchema 初始化数据库表结构(幂等操作,可重复调用)。 |
| 40 | InitSchema(ctx context.Context) error |
| 41 | // InsertSnapshotsAttachment 插入本地备份元数据记录。 |
| 42 | InsertSnapshotsAttachment(ctx context.Context, att domain.SnapshotAttachment) error |
| 43 | // InsertStorageSnapshotsAttachment 插入远端存储备份元数据记录。 |
| 44 | InsertStorageSnapshotsAttachment(ctx context.Context, att domain.StorageSnapshotAttachment) error |
| 45 | } |
| 46 | |
| 47 | // IDGenerator 定义 ID 生成器接口。 |
| 48 | // 使用场景:为本地备份记录和远端存储记录生成全局唯一的主键 ID。 |
no outgoing calls
no test coverage detected