exporter

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: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DatabaseFilename = "modctl.db"
View Source
const ExportFormatVersion = 1

Variables

This section is empty.

Functions

func ExportCacheFileInfo added in v0.7.0

func ExportCacheFileInfo(ctx context.Context, src, dst *dbc.Queries, domain string, modID int64) error

func ExportCacheFileUpdates added in v0.7.0

func ExportCacheFileUpdates(ctx context.Context, src, dst *dbc.Queries, domain string, modID int64) error

func ExportCacheModInfo added in v0.7.0

func ExportCacheModInfo(ctx context.Context, src, dst *dbc.Queries, domain string, modID int64) error

func Full

func Full(
	ctx context.Context,
	db *sql.DB,
	q *dbq.Queries,
	bs blobstore.Store,
	opts Options,
) error

Full performs a full export of the entire modctl state.

func Game

func Game(
	ctx context.Context,
	db *sql.DB,
	q *dbq.Queries,
	bs blobstore.Store,
	gi dbq.GameInstall,
	opts Options,
) error

Game performs a game-scoped export containing only data relevant to a single game install.

func Slugify

func Slugify(s string) string

slugify converts a game display name to a safe filename slug.

e.g. "Cyberpunk 2077" -> "cyberpunk2077"

"The Elder Scrolls V: Skyrim" -> "the-elder-scrolls-v-skyrim"

Types

type ExportKind

type ExportKind string
const (
	ExportKindFull ExportKind = "full"
	ExportKindGame ExportKind = "game"
)

type Manifest

type Manifest struct {
	ExportFormatVersion int            `json:"export_format_version"`
	ExportKind          ExportKind     `json:"export_kind"`
	ExportedAt          time.Time      `json:"exported_at"`
	ModctlVersion       string         `json:"modctl_version"`
	SchemaVersion       int64          `json:"schema_version"`
	DBSha256            string         `json:"db_sha256"`
	NexusCacheSha256    string         `json:"nexus_cache_sha256"`
	Counts              ManifestCounts `json:"counts"`
	Game                *ManifestGame  `json:"game,omitempty"`
}

type ManifestCounts

type ManifestCounts struct {
	Archives  int `json:"archives"`
	Backups   int `json:"backups"`
	Overrides int `json:"overrides"`
}

type ManifestGame

type ManifestGame struct {
	StoreID     string `json:"store_id"`
	StoreGameID string `json:"store_game_id"`
	DisplayName string `json:"display_name"`
}

type Options

type Options struct {
	// ModctlVersion is injected from rootCmd.Version
	ModctlVersion string
	// SkipInventory omits archive_inventory_entries from game-scoped exports
	SkipInventory bool
	// OutputPath is the destination file
	OutputPath string
	// NoVerify skips rehashing blobs before export
	NoVerify bool
	// CacheDBPath is the full path to the nexus_cache.db
	CacheDBPath string
}

Jump to

Keyboard shortcuts

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