snapshot

package
v1.0.38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

func (e *Engine) DeleteSnapshot(ctx context.Context, snapshotID string) error

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

func (e *Engine) PruneAllSnapshots(ctx context.Context) (int, error)

PruneAllSnapshots runs retention pruning across all registered servers.

func (*Engine) PruneSnapshots

func (e *Engine) PruneSnapshots(ctx context.Context, serverID string) (int, error)

PruneSnapshots enforces retention limits (max count and age) for a server.

func (*Engine) Rollback

func (e *Engine) Rollback(ctx context.Context, server *storage.Server, snapshotID string) error

Rollback restores a server to the specified snapshot state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL