mod_installer

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModInstaller

type ModInstaller struct {
	ModsDir               string
	InstalledDependencies []*ResolvedModRef
}

func NewModInstaller

func NewModInstaller(workspacePath string) *ModInstaller

func (*ModInstaller) GetModRefForVersion

func (i *ModInstaller) GetModRefForVersion(modVersion *modconfig.ModVersion) (*ResolvedModRef, error)

func (*ModInstaller) InstallModDependencies

func (i *ModInstaller) InstallModDependencies(mod *modconfig.Mod) error

InstallModDependencies installs all dependencies of the mod

func (*ModInstaller) InstallReport

func (i *ModInstaller) InstallReport() string

type ModRef

type ModRef struct {
	// the Git URL of the mod repo
	Name string
	// contains filtered or unexported fields
}

ModRef is a struct to represent an unresolved mod reference

func NewModRef

func NewModRef(modRef string) (*ModRef, error)

type ResolvedModRef

type ResolvedModRef struct {
	// the FQN of the mod - also the Git URL of the mod repo
	Name string
	// the Git branch/tag
	GitReference plumbing.ReferenceName
	// the monotonic version - may be unknown for local or branch
	// although version will be monotonic, we can still use semver
	Version *goVersion.Version
	// the file path for local mods
	FilePath string
}

ResolvedModRef is a struct to represent a resolved mod reference

func NewResolvedModRef

func NewResolvedModRef(modVersion *modconfig.ModVersion) (*ResolvedModRef, error)

func (*ResolvedModRef) FullName

func (r *ResolvedModRef) FullName() string

FullName returns name in the format <dependency name>@v<dependencyVersion>

func (*ResolvedModRef) SatisfiesVersionConstraint

func (r *ResolvedModRef) SatisfiesVersionConstraint(versionConstraint *goVersion.Version) bool

SatisfiesVersionConstraint return whether this resolved ref satisfies a version constraint

func (*ResolvedModRef) SetGitReference

func (r *ResolvedModRef) SetGitReference(modVersion *modconfig.ModVersion)

Jump to

Keyboard shortcuts

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