Documentation
¶
Index ¶
- type Config
- type Engine
- func (e *Engine) CreatePreUpdateSnapshot(ctx context.Context, server *storage.Server, reason string) (*storage.ServerSnapshot, error)
- func (e *Engine) DeleteSnapshot(ctx context.Context, snapshotID string) error
- func (e *Engine) ListSnapshots(ctx context.Context, serverID string) ([]*storage.ServerSnapshot, error)
- func (e *Engine) PruneAllSnapshots(ctx context.Context) (int, error)
- func (e *Engine) PruneSnapshots(ctx context.Context, serverID string) (int, error)
- func (e *Engine) Rollback(ctx context.Context, server *storage.Server, snapshotID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BackupDir string
MaxSnapshots int // Max pre-update snapshots to retain per server (default: 5)
RetentionDays int // Max age in days to retain pre-update snapshots (0 = unlimited age)
}
Config holds configuration for the SnapshotEngine
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine manages volume snapshots, pre-update backups, and rollbacks for servers (MINE-23)
func NewEngine ¶
func NewEngine(store *storage.Store, dockerClient *docker.Client, sender *command.Sender, log *logger.Logger, cfg ...Config) *Engine
NewEngine creates a new SnapshotEngine
func NewEngineWithPool ¶
func NewEngineWithPool(store *storage.Store, dockerClient *docker.Client, pool *docker.ClientPool, sender *command.Sender, log *logger.Logger, cfg ...Config) *Engine
NewEngineWithPool creates a new SnapshotEngine with a multi-node ClientPool. If pool is nil and dockerClient is non-nil, a single-node pool wrapping dockerClient is created.
func (*Engine) CreatePreUpdateSnapshot ¶
func (e *Engine) CreatePreUpdateSnapshot(ctx context.Context, server *storage.Server, reason string) (*storage.ServerSnapshot, error)
CreatePreUpdateSnapshot creates an atomic volume snapshot before updating modpacks or configs
func (*Engine) DeleteSnapshot ¶
DeleteSnapshot removes a snapshot from DB and disk
func (*Engine) ListSnapshots ¶
func (e *Engine) ListSnapshots(ctx context.Context, serverID string) ([]*storage.ServerSnapshot, error)
ListSnapshots returns all snapshots for a server
func (*Engine) PruneAllSnapshots ¶
PruneAllSnapshots runs retention pruning across all registered servers.
func (*Engine) PruneSnapshots ¶
PruneSnapshots enforces retention limits (max count and age) for a server.