modinstaller

package
v0.19.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerbInstalled   = "Installed"
	VerbUninstalled = "Uninstalled"
	VerbUpgraded    = "Upgraded"
	VerbDowngraded  = "Downgraded"
	VerbPruned      = "Pruned"
)

Variables

This section is empty.

Functions

func BuildInstallSummary

func BuildInstallSummary(installData *InstallData) string

func BuildPruneSummary

func BuildPruneSummary(pruned versionmap.VersionListMap) string

func BuildUninstallSummary

func BuildUninstallSummary(installData *InstallData) string

Types

type InstallData

type InstallData struct {
	// record of the full dependency tree
	Lock    *versionmap.WorkspaceLock
	NewLock *versionmap.WorkspaceLock

	// list of dependencies installed by recent install operation
	Installed versionmap.DependencyVersionMap
	// list of dependencies which have been upgraded
	Upgraded versionmap.DependencyVersionMap
	// list of dependencies which have been downgraded
	Downgraded versionmap.DependencyVersionMap
	// list of dependencies which have been uninstalled
	Uninstalled  versionmap.DependencyVersionMap
	WorkspaceMod *modconfig.Mod
	// contains filtered or unexported fields
}

func InstallWorkspaceDependencies

func InstallWorkspaceDependencies(opts *InstallOpts) (_ *InstallData, err error)

func NewInstallData

func NewInstallData(workspaceLock *versionmap.WorkspaceLock, workspaceMod *modconfig.Mod) *InstallData

func UninstallWorkspaceDependencies

func UninstallWorkspaceDependencies(ctx context.Context, opts *InstallOpts) (*InstallData, error)

func (*InstallData) GetAvailableUpdates

func (d *InstallData) GetAvailableUpdates() (versionmap.DependencyVersionMap, error)

GetAvailableUpdates returns a map of all installed mods which are not in the lock file

func (*InstallData) GetInstalledTree

func (d *InstallData) GetInstalledTree() treeprint.Tree

func (*InstallData) GetUninstalledTree

func (d *InstallData) GetUninstalledTree() treeprint.Tree

func (*InstallData) GetUpdatedTree

func (d *InstallData) GetUpdatedTree() treeprint.Tree

type InstallOpts

type InstallOpts struct {
	WorkspacePath string
	Command       string
	DryRun        bool
	ModArgs       []string
}

type ModInstaller

type ModInstaller struct {
	// contains filtered or unexported fields
}

func NewModInstaller

func NewModInstaller(opts *InstallOpts) (*ModInstaller, error)

func (*ModInstaller) GetModList

func (i *ModInstaller) GetModList() string

func (*ModInstaller) GetRequiredModVersionsFromArgs

func (i *ModInstaller) GetRequiredModVersionsFromArgs(modsArgs []string) (versionmap.VersionConstraintMap, error)

func (*ModInstaller) InstallWorkspaceDependencies

func (i *ModInstaller) InstallWorkspaceDependencies() (err error)

InstallWorkspaceDependencies installs all dependencies of the workspace mod

func (*ModInstaller) Prune

func (*ModInstaller) UninstallWorkspaceDependencies

func (i *ModInstaller) UninstallWorkspaceDependencies() error

type ResolvedModRef

type ResolvedModRef struct {
	// the FQN of the mod - also the Git URL of the mod repo
	Name string
	// the mod version
	Version *semver.Version
	// the vestion constraint
	Constraint *versionhelpers.Constraints
	// the Git branch/tag
	GitReference plumbing.ReferenceName
	// the file path for local mods
	FilePath string
}

ResolvedModRef is a struct to represent a resolved mod git reference

func NewResolvedModRef

func NewResolvedModRef(requiredModVersion *modconfig.ModVersionConstraint, version *semver.Version) (*ResolvedModRef, error)

func (*ResolvedModRef) FullName

func (r *ResolvedModRef) FullName() string

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

Jump to

Keyboard shortcuts

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