versionmanager

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCompatibleLocally = errors.New("no compatible version found locally")
)

Functions

This section is empty.

Types

type DatedVersion added in v2.5.0

type DatedVersion struct {
	UseDate time.Time
	Version string
}

type ReleaseInfoRetriever

type ReleaseInfoRetriever interface {
	InstallRelease(version string, targetPath string) error
	ListReleases() ([]string, error)
}

type VersionManager

type VersionManager struct {
	FolderName string

	VersionEnvName string

	VersionFiles []types.VersionFile
	// contains filtered or unexported fields
}

func Make

func Make(conf *config.Config, constraintEnvName string, folderName string, iacExts []iacparser.ExtDescription, retriever ReleaseInfoRetriever, versionEnvName string, defaultVersionEnvName string, versionFiles []types.VersionFile) VersionManager

func (VersionManager) Detect

func (m VersionManager) Detect(proxyCall bool) (string, error)

Detect version (resolve and evaluate, can install depending on auto install env var).

func (VersionManager) Evaluate

func (m VersionManager) Evaluate(requestedVersion string, proxyCall bool) (string, error)

Evaluate version resolution strategy or version constraint (can install depending on auto install env var).

func (VersionManager) Install

func (m VersionManager) Install(requestedVersion string) error

func (VersionManager) InstallPath

func (m VersionManager) InstallPath() (string, error)

try to ensure the directory exists with a MkdirAll call. (made lazy method : not always useful and allows flag override for root path).

func (VersionManager) ListLocal

func (m VersionManager) ListLocal(reverseOrder bool) ([]DatedVersion, error)

func (VersionManager) ListRemote

func (m VersionManager) ListRemote(reverseOrder bool) ([]string, error)

func (VersionManager) LocalSet

func (m VersionManager) LocalSet() map[string]struct{}

func (VersionManager) ReadDefaultConstraint

func (m VersionManager) ReadDefaultConstraint() string

func (VersionManager) ResetConstraint

func (m VersionManager) ResetConstraint() error

func (VersionManager) ResetVersion

func (m VersionManager) ResetVersion() error

func (VersionManager) Resolve

func (m VersionManager) Resolve(defaultStrategy string) (string, error)

Search the requested version in version files (with fallbacks and env var overloading).

func (VersionManager) ResolveWithVersionFiles

func (m VersionManager) ResolveWithVersionFiles() (string, error)

Search the requested version in version files.

func (VersionManager) RootConstraintFilePath

func (m VersionManager) RootConstraintFilePath() string

(made lazy method : not always useful and allows flag override for root path).

func (VersionManager) RootVersionFilePath

func (m VersionManager) RootVersionFilePath() string

(made lazy method : not always useful and allows flag override for root path).

func (VersionManager) SetConstraint

func (m VersionManager) SetConstraint(constraint string) error

func (VersionManager) Uninstall

func (m VersionManager) Uninstall(requestedVersion string) error

func (VersionManager) UninstallMultiple added in v2.5.0

func (m VersionManager) UninstallMultiple(versions []string) error

func (VersionManager) Use

func (m VersionManager) Use(requestedVersion string, workingDir bool) error

Jump to

Keyboard shortcuts

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