runtimes

package
v0.41.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type IRuntime

type IRuntime interface {
	// Parse will parse string with module name. It is used only on `toolset add` step.
	// Parse should:
	//	1) ensure that this program is valid, exists, and can be installed.
	//	2) normalize program name and return a canonical name.
	Parse(ctx context.Context, str string) (string, error)
	// GetModule returns an information about module (parsed module).
	GetModule(ctx context.Context, program string) (*structs.ModuleInfo, error)
	// Install will install the program.
	Install(ctx context.Context, program string) error
	Run(ctx context.Context, program string, args ...string) error
	GetLatest(ctx context.Context, module string) (string, bool, error)
	Remove(ctx context.Context, tool structs.Tool) error
	Version() string
}

type Runtimes

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

func New

func New(fs fsh.FS, binToolDir string) (*Runtimes, error)

func (*Runtimes) Discover

func (r *Runtimes) Discover(ctx context.Context) error

func (*Runtimes) EnsureInstalled added in v0.25.2

func (r *Runtimes) EnsureInstalled(ctx context.Context, runtime string) (string, error)

func (*Runtimes) Get

func (r *Runtimes) Get(runtime string) (IRuntime, error)

func (*Runtimes) GetInstall

func (r *Runtimes) GetInstall(ctx context.Context, runtime string) (IRuntime, error)

GetInstall will get installed runtime or try to install it in other case.

func (*Runtimes) List

func (r *Runtimes) List() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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