Documentation
¶
Index ¶
- Variables
- type DatedVersion
- type EnvPrefix
- type ReleaseRetriever
- type VersionManager
- func (m VersionManager) Detect(ctx context.Context, proxyCall bool, noFallback bool) (string, error)
- func (m VersionManager) Evaluate(ctx context.Context, requestedVersion string, proxyCall bool) (string, error)
- func (m VersionManager) Install(ctx context.Context, requestedVersion string) error
- func (m VersionManager) InstallMultiple(ctx context.Context, versions []string) error
- func (m VersionManager) InstallPath() (string, error)
- func (m VersionManager) ListLocal(reverseOrder bool) ([]DatedVersion, error)
- func (m VersionManager) ListRemote(ctx context.Context, reverseOrder bool) ([]string, error)
- func (m VersionManager) LocalSet() map[string]struct{}
- func (m VersionManager) ReadDefaultConstraint() string
- func (m VersionManager) ResetConstraint() error
- func (m VersionManager) ResetVersion() error
- func (m VersionManager) Resolve(defaultStrategy string) (string, error)
- func (m VersionManager) ResolveStrict() (string, error)
- func (m VersionManager) ResolveWithVersionFiles() (string, error)
- func (m VersionManager) RootConstraintFilePath() string
- func (m VersionManager) RootVersionFilePath() string
- func (m VersionManager) SetConstraint(constraint string) error
- func (m VersionManager) Uninstall(requestedVersion string) error
- func (m VersionManager) UninstallMultiple(versions []string) error
- func (m VersionManager) Use(ctx context.Context, requestedVersion string, workingDir bool) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoCompatibleLocally = errors.New("no compatible version found locally") ErrNoVersionFilesFound = errors.New("no version files found") )
Functions ¶
This section is empty.
Types ¶
type DatedVersion ¶
type ReleaseRetriever ¶
type VersionManager ¶
type VersionManager struct {
Conf *config.Config
EnvNames EnvPrefix
FolderName string
VersionFiles []types.VersionFile
// contains filtered or unexported fields
}
func Make ¶
func Make(conf *config.Config, envPrefix string, folderName string, iacExts []iacparser.ExtDescription, retriever ReleaseRetriever, versionFiles []types.VersionFile) VersionManager
func (VersionManager) Detect ¶
func (m VersionManager) Detect(ctx context.Context, proxyCall bool, noFallback bool) (string, error)
Detect version (resolve and evaluate, can install depending on auto install env var). When noFallback is true, returns ErrNoVersionFilesFound if no version files are found instead of using fallback strategy.
func (VersionManager) Evaluate ¶
func (m VersionManager) Evaluate(ctx context.Context, 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(ctx context.Context, requestedVersion string) error
func (VersionManager) InstallMultiple ¶
func (m VersionManager) InstallMultiple(ctx context.Context, versions []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 (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) ResolveStrict ¶ added in v4.9.3
func (m VersionManager) ResolveStrict() (string, error)
ResolveStrict Search the requested version in version files (with fallbacks and env var overloading, but no default strategy fallback). Returns ErrNoVersionFilesFound if no version is found.
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 ¶
func (m VersionManager) UninstallMultiple(versions []string) error