domain

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrModNotFound     = errors.New("mod not found")
	ErrGameNotFound    = errors.New("game not found")
	ErrProfileNotFound = errors.New("profile not found")
	ErrDependencyLoop  = errors.New("circular dependency detected")
	ErrAuthRequired    = errors.New("authentication required")
	ErrInvalidConfig   = errors.New("invalid configuration")
	ErrFileConflict    = errors.New("file conflict detected")
	ErrDownloadFailed  = errors.New("download failed")
	ErrLinkFailed      = errors.New("link operation failed")
)

Functions

This section is empty.

Types

type DownloadableFile

type DownloadableFile struct {
	ID          string // Source-specific file ID
	Name        string // Display name
	FileName    string // Actual filename (e.g., "mod-1.0.zip")
	Version     string // File version
	Size        int64  // Size in bytes
	IsPrimary   bool   // Whether this is the primary/main file
	Category    string // Category: "MAIN", "OPTIONAL", "UPDATE", etc.
	Description string // File description
}

DownloadableFile represents a file available for download from a mod source

type ExportedProfile

type ExportedProfile struct {
	Name       string         `yaml:"name"`
	GameID     string         `yaml:"game_id"`
	Mods       []ModReference `yaml:"mods"`
	LinkMethod string         `yaml:"link_method,omitempty"`
}

ExportedProfile is the YAML-serializable format for sharing

type Game

type Game struct {
	ID                 string            // Unique slug, e.g., "skyrim-se"
	Name               string            // Display name
	InstallPath        string            // Game installation directory
	ModPath            string            // Where mods should be deployed
	SourceIDs          map[string]string // Map source to game ID, e.g., "nexusmods" -> "skyrimspecialedition"
	LinkMethod         LinkMethod        // How to deploy mods
	LinkMethodExplicit bool              // True if LinkMethod was explicitly set in config
	CachePath          string            // Optional: custom cache path for this game's mods
}

Game represents a moddable game

type InstalledMod

type InstalledMod struct {
	Mod
	ProfileName     string
	UpdatePolicy    UpdatePolicy
	InstalledAt     time.Time
	Enabled         bool
	PreviousVersion string     // Version before last update (for rollback)
	LinkMethod      LinkMethod // How the mod was deployed (symlink, hardlink, copy)
	FileIDs         []string   // Source-specific file IDs that were downloaded
}

InstalledMod tracks a mod installed in a profile

type LinkMethod

type LinkMethod int

LinkMethod determines how mods are deployed to game directories

const (
	LinkSymlink  LinkMethod = iota // Default: symlink (space efficient)
	LinkHardlink                   // Hardlink (transparent to games)
	LinkCopy                       // Copy (maximum compatibility)
)

func ParseLinkMethod

func ParseLinkMethod(s string) LinkMethod

ParseLinkMethod converts a string to LinkMethod

func (LinkMethod) String

func (m LinkMethod) String() string

type Mod

type Mod struct {
	ID           string
	SourceID     string
	Name         string
	Version      string
	Author       string
	Summary      string
	Description  string
	GameID       string
	Category     string
	Downloads    int64
	Endorsements int64
	Files        []ModFile
	Dependencies []ModReference
	UpdatedAt    time.Time
}

Mod represents a mod from any source

type ModFile

type ModFile struct {
	Path     string // Relative path within mod archive
	Size     int64
	Checksum string // SHA256
}

ModFile represents a single file within a mod archive (after extraction)

type ModReference

type ModReference struct {
	SourceID string   `yaml:"source_id"`          // "nexusmods", "curseforge", etc.
	ModID    string   `yaml:"mod_id"`             // Source-specific identifier
	Version  string   `yaml:"version"`            // Empty string means "latest"
	FileIDs  []string `yaml:"file_ids,omitempty"` // Source-specific file IDs that were installed
}

ModReference is a pointer to a mod (used in profiles, dependencies)

type Profile

type Profile struct {
	Name       string            // Profile identifier
	GameID     string            // Which game this profile is for
	Mods       []ModReference    // Mods in load order (first = lowest priority)
	Overrides  map[string][]byte // Config file overrides (path -> content)
	LinkMethod LinkMethod        // Override game's default link method (optional)
	IsDefault  bool              // Is this the default profile for the game?
}

Profile represents a collection of mods with a specific configuration

type Update

type Update struct {
	InstalledMod InstalledMod
	NewVersion   string
	Changelog    string
}

Update represents an available update for an installed mod

type UpdatePolicy

type UpdatePolicy int

UpdatePolicy determines how a mod handles updates

const (
	UpdateNotify UpdatePolicy = iota // Default: show available, require approval
	UpdateAuto                       // Automatically apply updates
	UpdatePinned                     // Never update
)

Jump to

Keyboard shortcuts

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