runtime

package
v0.0.0-...-0bde480 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultRuntimeName = "deno"

DefaultRuntimeName is the runtime used when none are specified or detected

Variables

This section is empty.

Functions

func ActivatePythonVenvIfPresent

func ActivatePythonVenvIfPresent(fs afero.Fs, os types.Os, projectDir string) (bool, error)

ActivatePythonVenvIfPresent activates a Python virtual environment if one exists in the given project directory. This sets VIRTUAL_ENV, prepends the venv bin directory to PATH, and unsets PYTHONHOME on the current process so that child processes (hook scripts) inherit the activated venv.

Types

type Runtime

type Runtime interface {
	IgnoreDirectories() []string
	InstallProjectDependencies(context.Context, string, hooks.HookExecutor, iostreams.IOStreamer, afero.Fs, types.Os) (string, error)
	Name() string
	Version() string
	SetVersion(string)
	HooksJSONTemplate() []byte
	PreparePackage(context.Context, hooks.SDKCLIConfig, hooks.HookExecutor, types.PreparePackageOpts) error
}

Runtime interface generalizes the required functionality for any runtime language. Example runtimes: Node.js, Deno, Python, Java, etc.

func New

func New(runtimeName string) (Runtime, error)

New creates a new runtime using runtimeName to choose the runtime

runtimeName uses the hosted version pattern, e.g. deno1.1, deno1.x

func NewDetectProject

func NewDetectProject(ctx context.Context, fs afero.Fs, dirPath string, sdkConfig hooks.SDKCLIConfig) (Runtime, error)

NewDetectProject returns a new Runtime based on the project type of dirPath

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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