restore

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	Manifest  exporter.Manifest
	BundleDir string // temp dir where bundle was extracted
	BundleDB  *sql.DB
}

Bundle is the extracted, validated contents of an import bundle. It holds the temp directory and opened bundle DB until Close is called.

func OpenAndValidate

func OpenAndValidate(ctx context.Context, bundlePath string) (*Bundle, error)

OpenAndValidate extracts the bundle, verifies integrity, and returns a validated Bundle ready for import. Caller must call Close() when done.

func (*Bundle) Close

func (b *Bundle) Close()

type Options

type Options struct {
	SkipInventory bool
	Force         bool
	DryRun        bool
	SameMachine   bool
	Game          string // "store_id:store_game_id", only set when extracting a game from a full bundle
	CacheDBPath   string
}

type Result

type Result struct {
	// counts of what was imported
	Archives         int
	Backups          int
	Overrides        int
	ModPages         int
	Profiles         int
	InventoryScanned int
	InventoryFailed  int
}

func Full

func Full(
	ctx context.Context,
	db *sql.DB,
	q *dbq.Queries,
	bs blobstore.Store,
	bundle *Bundle,
	opts Options,
	dbPath string,
	modctlVersion string,
	logger *slog.Logger,
) (Result, error)

Full imports a full bundle into a fresh database.

func Game

func Game(
	ctx context.Context,
	db *sql.DB,
	q *dbq.Queries,
	bs blobstore.Store,
	bundle *Bundle,
	opts Options,
	modctlVersion string,
	logger *slog.Logger,
) (Result, error)

Game imports a game-scoped bundle into an existing database.

Jump to

Keyboard shortcuts

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