modmgr

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const FeatureDirectJoin = "direct_join"
View Source
const InstallationInfoFileName = ".mod_installation"

Variables

This section is empty.

Functions

func DownloadMods added in v1.1.0

func DownloadMods(cacheDir string, modVersions []ModVersion, binaryType aumgr.BinaryType, progressListener progress.Progress, force bool) error

func PrepareProfileDirectory added in v1.1.0

func PrepareProfileDirectory(profileDir string, cacheDir string, modVersions []ModVersion, binaryType aumgr.BinaryType, gameVersion string, force bool, progressListener progress.Progress) error

PrepareProfileDirectory installs mods from cache to the profile directory and generates doorstop_config.ini.

func ResolveDependencies added in v1.1.0

func ResolveDependencies(initialMods []ModVersion, provider VersionProvider) (map[string]ModVersion, error)

ResolveDependencies recursively finds all required dependencies for a given set of mod versions. It returns a map of ModID to ModVersion containing all original mods and their required dependencies.

func SaveInstallationInfo

func SaveInstallationInfo(gameRoot *os.Root, installation *ModInstallation) error

func UninstallMod

func UninstallMod(modInstallLocation *os.Root, progress progress.Progress, remainMods []ModVersion) error

Types

type HashCheckingWriter added in v1.4.2

type HashCheckingWriter interface {
	io.Writer
	Sum() (map[string]string, error)
}

type InstallStatus

type InstallStatus string
const (
	InstallStatusCompatible   InstallStatus = "compatible"
	InstallStatusIncompatible InstallStatus = "incompatible"
	InstallStatusBroken       InstallStatus = "broken"
	InstallStatusUnknown      InstallStatus = "unknown"
)

type InstalledVersionInfo added in v1.1.0

type InstalledVersionInfo struct {
	ModVersion `json:",inline"`
	Paths      []string `json:"paths"`
}

func UninstallRemainingMods

func UninstallRemainingMods(modInstallLocation *os.Root, progress progress.Progress, remainMods []ModVersion) ([]InstalledVersionInfo, error)

type Mod

type Mod struct {
	model.ModDetails
}

type ModDependency deprecated

type ModDependency struct {
	ID      string            `json:"id"`
	Version string            `json:"version,omitempty"`
	Type    ModDependencyType `json:"type"`
}

Deprecated: use model.ModVersionDependency instead

type ModDependencyType

type ModDependencyType = model.DependencyType
const (
	ModDependencyTypeRequired ModDependencyType = model.DependencyTypeRequired
	ModDependencyTypeOptional ModDependencyType = model.DependencyTypeOptional
	ModDependencyTypeConflict ModDependencyType = model.DependencyTypeConflict
	ModDependencyTypeEmbedded ModDependencyType = model.DependencyTypeEmbedded
)

type ModInstallation deprecated

type ModInstallation struct {
	FileVersion          int                    `json:"file_version"`
	InstalledMods        []InstalledVersionInfo `json:"installed_mods"`
	InstalledGameVersion string                 `json:"installed_game_version"`
	Status               InstallStatus          `json:"status"`
	// contains filtered or unexported fields
}

Deprecated: Should use profile.Profile to track installed mods instead.

func LoadInstallationInfo

func LoadInstallationInfo(modInstallLocation *os.Root) (*ModInstallation, error)

func (*ModInstallation) MarshalJSON

func (mi *ModInstallation) MarshalJSON() ([]byte, error)

func (*ModInstallation) OldVanillaFiles

func (mi *ModInstallation) OldVanillaFiles() []string

For file versions 0 and 1, return the list of vanilla files stored in the installation data.

func (*ModInstallation) UnmarshalJSON

func (mi *ModInstallation) UnmarshalJSON(data []byte) error

type ModPack deprecated

type ModPack struct {
	ID      string `json:"id"`
	Version string `json:"version,omitempty"`
}

Deprecated: use profile.Profile to represent mod packs now

type ModType

type ModType string
const (
	ModTypeMod     ModType = "mod"
	ModTypeLibrary ModType = "library"
	// Deprecated: should not be used anymore
	// ModPack will be represented as profile.Profile now
	ModTypeModPack ModType = "modpack"
)

func (ModType) IsVisible

func (mt ModType) IsVisible() bool

type ModVersion

type ModVersion struct {
	model.ModVersionDetails
}

func (ModVersion) CompatibleFilesCount

func (m ModVersion) CompatibleFilesCount(binaryType aumgr.BinaryType) int

func (ModVersion) Downloads

func (m ModVersion) Downloads(binaryType aumgr.BinaryType) iter.Seq[model.ModVersionFile]

func (ModVersion) HasFeature added in v1.6.0

func (m ModVersion) HasFeature(feature string) bool

func (ModVersion) IsCompatible

func (m ModVersion) IsCompatible(launcherType aumgr.LauncherType, binaryType aumgr.BinaryType, gameVersion string) bool

type ProfileMetadata added in v1.1.0

type ProfileMetadata struct {
	ModVersions []ModVersion     `json:"mod_versions"`
	GameVersion string           `json:"game_version"`
	BinaryType  aumgr.BinaryType `json:"binary_type"`
}

func GetProfileMetadata added in v1.1.0

func GetProfileMetadata(profileDir string) (*ProfileMetadata, error)

type RestoreInfo added in v1.1.0

type RestoreInfo struct {
	BackupDir string            `json:"backup_dir"`
	Added     []string          `json:"added"`
	Moved     map[string]string `json:"moved"` // Original Path -> Backup Path
}

func ApplyMods added in v1.1.0

func ApplyMods(gameDir string, cacheDir string, modVersions []ModVersion, binaryType aumgr.BinaryType) (*RestoreInfo, error)

type VersionProvider added in v1.1.0

type VersionProvider interface {
	GetModVersion(modID string, versionID string) (*ModVersion, error)
	GetLatestModVersion(modID string) (*ModVersion, error)
	GetModVersionIDs(modID string, limit int, after string) ([]string, error)
}

VersionProvider is an interface to fetch mod version details.

Jump to

Keyboard shortcuts

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