tenvlib

package
v3.2.12 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoInstall

func AutoInstall(tc *tenvConfig)

func DisableDisplay

func DisableDisplay(tc *tenvConfig)

func IgnoreEnv

func IgnoreEnv(tc *tenvConfig)

Types

type Tenv

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

Not concurrent safe.

func Make

func Make(options ...TenvOption) (Tenv, error)

The returned wrapper is not concurrent safe.

func (Tenv) Command

func (t Tenv) Command(ctx context.Context, toolName string, requestedVersion string, cmdArgs ...string) (*exec.Cmd, error)

return an exec.Cmd in order to call the specified tool version (need to have it installed for the Cmd call to work).

func (Tenv) CommandProxy

func (t Tenv) CommandProxy(ctx context.Context, toolName string, requestedVersion string, cmdArgs ...string) error

Use the result of Tenv.Command to call cmdproxy.Run (Always call os.Exit).

func (Tenv) Detect

func (t Tenv) Detect(ctx context.Context, toolName string) (string, error)

Detect version (resolve and evaluate, can install depending on configuration).

func (Tenv) DetectedCommand

func (t Tenv) DetectedCommand(ctx context.Context, toolName string, cmdArgs ...string) (*exec.Cmd, error)

Use the result of Tenv.Detect to call Tenv.Command.

func (Tenv) DetectedCommandProxy

func (t Tenv) DetectedCommandProxy(ctx context.Context, toolName string, cmdArgs ...string) error

Use the result of Tenv.DetectedCommand to call cmdproxy.Run (Always call os.Exit).

func (Tenv) Evaluate

func (t Tenv) Evaluate(ctx context.Context, toolName string, requestedVersion string) (string, error)

Evaluate version resolution strategy or version constraint (can install depending on configuration).

func (Tenv) Install

func (t Tenv) Install(ctx context.Context, toolName string, requestedVersion string) error

func (Tenv) InstallMultiple

func (t Tenv) InstallMultiple(ctx context.Context, toolName string, versions []string) error

func (Tenv) ListLocal

func (t Tenv) ListLocal(_ context.Context, toolName string, reverseOrder bool) ([]versionmanager.DatedVersion, error)

func (Tenv) ListRemote

func (t Tenv) ListRemote(ctx context.Context, toolName string, reverseOrder bool) ([]string, error)

func (Tenv) LocallyInstalled

func (t Tenv) LocallyInstalled(_ context.Context, toolName string) (map[string]struct{}, error)

func (Tenv) ResetDefaultConstraint

func (t Tenv) ResetDefaultConstraint(_ context.Context, toolName string) error

func (Tenv) ResetDefaultVersion

func (t Tenv) ResetDefaultVersion(_ context.Context, toolName string) error

func (Tenv) SetDefaultConstraint

func (t Tenv) SetDefaultConstraint(_ context.Context, toolName string, constraint string) error

func (Tenv) SetDefaultVersion

func (t Tenv) SetDefaultVersion(ctx context.Context, toolName string, requestedVersion string, workingDir bool) error

func (Tenv) Uninstall

func (t Tenv) Uninstall(_ context.Context, toolName string, requestedVersion string) error

Does not handle special behavior.

func (Tenv) UninstallMultiple

func (t Tenv) UninstallMultiple(_ context.Context, toolName string, versions []string) error

type TenvOption

type TenvOption func(*tenvConfig)

func AddTool

func AddTool(toolName string, builderFunc builder.Func) TenvOption

add builder or override default builder (see builder.Builders).

func WithConfig

func WithConfig(conf *config.Config) TenvOption

func WithDisplayer

func WithDisplayer(displayer loghelper.Displayer) TenvOption

func WithHCLParser

func WithHCLParser(hclParser *hclparse.Parser) TenvOption

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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