versionmap

package
v0.2.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const WorkspaceLockStructVersion = 20220411

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyVersionMap

type DependencyVersionMap map[string]ResolvedVersionMap

func (DependencyVersionMap) Add

func (m DependencyVersionMap) Add(dependencyName, alias string, dependencyVersion *semver.Version, constraintString string, parentName string)

Add adds a dependency to the list of items installed for the given parent

func (DependencyVersionMap) FlatMap

FlatMap converts the DependencyVersionMap into a ResolvedVersionMap, keyed by mod dependency path

func (DependencyVersionMap) GetDependencyTree

func (m DependencyVersionMap) GetDependencyTree(rootName string) treeprint.Tree

func (DependencyVersionMap) GetDowngradedInOther

func (m DependencyVersionMap) GetDowngradedInOther(other DependencyVersionMap) DependencyVersionMap

func (DependencyVersionMap) GetMissingFromOther

func (m DependencyVersionMap) GetMissingFromOther(other DependencyVersionMap) DependencyVersionMap

GetMissingFromOther returns a map of dependencies which exit in this map but not 'other'

func (DependencyVersionMap) GetUpgradedInOther

type ResolvedVersionConstraint

type ResolvedVersionConstraint struct {
	Name          string          `json:"name,omitempty"`
	Alias         string          `json:"alias,omitempty"`
	Version       *semver.Version `json:"version,omitempty"`
	Constraint    string          `json:"constraint,omitempty"`
	StructVersion int             `json:"struct_version,omitempty"`
}

func NewResolvedVersionConstraint

func NewResolvedVersionConstraint(name, alias string, version *semver.Version, constraintString string) *ResolvedVersionConstraint

func (ResolvedVersionConstraint) DependencyPath

func (c ResolvedVersionConstraint) DependencyPath() string

func (ResolvedVersionConstraint) Equals

func (ResolvedVersionConstraint) IsPrerelease

func (c ResolvedVersionConstraint) IsPrerelease() bool

type ResolvedVersionListMap

type ResolvedVersionListMap map[string][]*ResolvedVersionConstraint

ResolvedVersionListMap represents a map of ResolvedVersionConstraint arrays, keyed by dependency name

func (ResolvedVersionListMap) Add

func (m ResolvedVersionListMap) Add(name string, versionConstraint *ResolvedVersionConstraint)

Add appends the version constraint to the list for the given name

func (ResolvedVersionListMap) FlatMap

FlatMap converts the ResolvedVersionListMap map into a map keyed by the FULL dependency name (i.e. including version(

func (ResolvedVersionListMap) FlatNames

func (m ResolvedVersionListMap) FlatNames() []string

FlatNames converts the ResolvedVersionListMap map into a string array of full names

func (ResolvedVersionListMap) Remove

func (m ResolvedVersionListMap) Remove(name string, constraint *ResolvedVersionConstraint)

Remove removes the given version constraint from the list for the given name

type ResolvedVersionMap

type ResolvedVersionMap map[string]*ResolvedVersionConstraint

ResolvedVersionMap represents a map of ResolvedVersionConstraint, keyed by dependency name

func (ResolvedVersionMap) Add

func (m ResolvedVersionMap) Add(name string, constraint *ResolvedVersionConstraint)

func (ResolvedVersionMap) Remove

func (m ResolvedVersionMap) Remove(name string)

func (ResolvedVersionMap) ToVersionListMap

func (m ResolvedVersionMap) ToVersionListMap() ResolvedVersionListMap

ToVersionListMap converts this map into a ResolvedVersionListMap

type VersionConstraintMap

type VersionConstraintMap map[string]*modconfig.ModVersionConstraint

type VersionListMap

type VersionListMap map[string]semver.Collection

VersionListMap is a map keyed by dependency name storing a list of versions for each dependency

func (VersionListMap) Add

func (m VersionListMap) Add(name string, version *semver.Version)

func (VersionListMap) FlatMap

func (m VersionListMap) FlatMap() map[string]bool

FlatMap converts the VersionListMap map into a bool map keyed by qualified dependency name

type VersionMap

type VersionMap map[string]*semver.Version

VersionMap represents a map of semver versions, keyed by dependency name

type WorkspaceLock

type WorkspaceLock struct {
	WorkspacePath   string
	InstallCache    DependencyVersionMap
	MissingVersions DependencyVersionMap

	ModInstallationPath string
	// contains filtered or unexported fields
}

WorkspaceLock is a map of ModVersionMaps items keyed by the parent mod whose dependencies are installed

func EmptyWorkspaceLock

func EmptyWorkspaceLock(existingLock *WorkspaceLock) *WorkspaceLock

EmptyWorkspaceLock creates a new empty workspace lock based, sharing workspace path and installedMods with 'existingLock'

func LoadWorkspaceLock

func LoadWorkspaceLock(workspacePath string) (*WorkspaceLock, error)

func (*WorkspaceLock) ContainsModConstraint

func (l *WorkspaceLock) ContainsModConstraint(modName string, constraint *versionhelpers.Constraints) bool

func (*WorkspaceLock) ContainsModVersion

func (l *WorkspaceLock) ContainsModVersion(modName string, modVersion *semver.Version) bool

ContainsModVersion returns whether the lockfile contains the given mod version

func (*WorkspaceLock) Delete

func (l *WorkspaceLock) Delete() error

Delete deletes the lock file

func (*WorkspaceLock) DeleteMods

func (l *WorkspaceLock) DeleteMods(mods VersionConstraintMap, parent *modconfig.Mod)

DeleteMods removes mods from the lock file then, if it is empty, deletes the file

func (*WorkspaceLock) Empty

func (l *WorkspaceLock) Empty() bool

Empty returns whether the install cache is empty

func (*WorkspaceLock) EnsureLockedModVersion

func (l *WorkspaceLock) EnsureLockedModVersion(requiredModVersion *modconfig.ModVersionConstraint, parent *modconfig.Mod) (*ResolvedVersionConstraint, error)

EnsureLockedModVersion looks for a lock file entry matching the required mod name

func (*WorkspaceLock) FindInstalledDependency

func (l *WorkspaceLock) FindInstalledDependency(modDependency *ResolvedVersionConstraint) (string, error)

func (*WorkspaceLock) GetLockedModVersion

func (l *WorkspaceLock) GetLockedModVersion(requiredModVersion *modconfig.ModVersionConstraint, parent *modconfig.Mod) (*ResolvedVersionConstraint, error)

GetLockedModVersion looks for a lock file entry matching the required constraint and returns nil if not found

func (*WorkspaceLock) GetLockedModVersionConstraint

func (l *WorkspaceLock) GetLockedModVersionConstraint(requiredModVersion *modconfig.ModVersionConstraint, parent *modconfig.Mod) (*modconfig.ModVersionConstraint, error)

GetLockedModVersionConstraint looks for a lock file entry matching the required mod version and if found, returns it in the form of a ModVersionConstraint

func (*WorkspaceLock) GetLockedModVersions

func (l *WorkspaceLock) GetLockedModVersions(mods VersionConstraintMap, parent *modconfig.Mod) (ResolvedVersionListMap, error)

GetLockedModVersions builds a ResolvedVersionListMap with the resolved versions for each item of the given VersionConstraintMap found in the lock file

func (*WorkspaceLock) GetMod

func (l *WorkspaceLock) GetMod(modDependencyName string, parent *modconfig.Mod) *ResolvedVersionConstraint

GetMod looks for a lock file entry matching the given mod dependency name (e.g.github.com/turbot/steampipe-mod-azure-thrifty

func (*WorkspaceLock) GetModList

func (l *WorkspaceLock) GetModList(rootName string) string

func (*WorkspaceLock) GetUnreferencedMods

func (l *WorkspaceLock) GetUnreferencedMods() VersionListMap

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

func (*WorkspaceLock) Incomplete

func (l *WorkspaceLock) Incomplete() bool

Incomplete returned whether there are any missing dependencies (i.e. they exist in the lock file but ate not installed)

func (*WorkspaceLock) Save

func (l *WorkspaceLock) Save() error

func (*WorkspaceLock) StructVersion

func (l *WorkspaceLock) StructVersion() int

StructVersion returns the struct version of the workspace lock because only the InstallCache is serialised, read the StructVersion from the first install cache entry

Jump to

Keyboard shortcuts

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