types

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrManifestExpired = errors.New("manifest expired")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(runtime, version string) (string, bool)
	Set(runtime, version, path string) error
	Path(runtime, version string) string
	SetManifest(runtime string, manifest []Version) error
	GetManifest(runtime string) ([]Version, error)
}

Cache manages downloaded runtimes

type Downloader

type Downloader interface {
	Download(ctx context.Context, url string, writer io.Writer) error
}

Downloader handles downloading files

type Extractor

type Extractor interface {
	Extract(src, dest string) error
}

Extractor handles archive extraction

type Platform

type Platform struct {
	OS   string
	Arch string
}

Platform represents the target platform

func GetPlatform

func GetPlatform() Platform

GetPlatform returns the current platform

type Runtime

type Runtime interface {
	// Get downloads and installs the specified version of the runtime
	// Returns the installation path
	Get(ctx context.Context, version string) (string, error)

	// GetLatest downloads and installs the latest stable version
	GetLatest(ctx context.Context) (string, error)

	// List returns available versions for the runtime
	List(ctx context.Context) ([]Version, error)

	// Name returns the name of the runtime (e.g., "go", "python", "node")
	Name() string
}

Runtime represents a downloadable runtime environment

type Version

type Version struct {
	Version      string
	Stable       bool
	ReleaseDate  string
	DownloadURLs map[string]string // key: platform-arch
}

Version represents a runtime version

Jump to

Keyboard shortcuts

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