Documentation
¶
Index ¶
Constants ¶
View Source
const ( BoolYes = "true" BoolNo = "false" UnLinkAttrFlag = "unlink" )
Variables ¶
View Source
var ErrRuntimeNotFound = errors.New("runtime not found")
Functions ¶
func IsUseUnLink ¶ added in v1.0.0
Types ¶
type AvailableRuntime ¶ added in v1.0.0
type AvailableRuntimePackage ¶ added in v1.0.0
type AvailableRuntimePackage struct {
*AvailableRuntime
Additions []*AvailableRuntime
}
type Metadata ¶ added in v1.0.0
type Metadata struct {
Name string
PluginMetadata *plugin.Metadata
SdkInstalledPath string
PluginInstalledPath string
}
Metadata contains the metadata of the SDK and plugin installed paths
type Runtime ¶ added in v1.0.0
type Runtime struct {
Name string `json:"name"`
Version Version `json:"version"`
Path string `json:"path"`
}
Runtime represents a runtime environment with its version and installation path.
type RuntimePackage ¶ added in v1.0.0
RuntimePackage represents a package of runtimes, including a main runtime and additional runtimes.
func (*RuntimePackage) ReplacePath ¶ added in v1.0.0
func (r *RuntimePackage) ReplacePath(parentPath string) *RuntimePackage
ReplacePath returns a new RuntimePackage with all runtimes' paths replaced by joining the parentPath and their names.
type Sdk ¶
type Sdk interface {
Install(version Version) error // Install a specific runtime of the SDK
Uninstall(version Version) error // Uninstall a specific runtime of the SDK
Available(args []string) ([]*AvailableRuntimePackage, error) // List available runtime of the SDK
EnvKeys(runtimePackage *RuntimePackage) (*env.Envs, error) // Get environment variables for a specific runtime of the SDK
Use(version Version, scope env.UseScope) error // Use a specific runtime in a given scope
UseWithConfig(version Version, scope env.UseScope, unlink bool) error // Use with link configuration
Unuse(scopes ...env.UseScope) error // Unuse the current runtime in a given scope
GetRuntimePackage(version Version) (*RuntimePackage, error) // Get the runtime package for a specific version
CheckRuntimeExist(version Version) bool // Check if a specific runtime version is installed
InstalledList() []Version
ParseLegacyFile(path string) (Version, error) // Parse legacy version file to get the runtime version
Current() Version
Metadata() *Metadata // Get the metadata of the SDK
// CreateSymlinksForScope creates symlinks for a specific version in the given scope
CreateSymlinksForScope(version Version, scope env.UseScope) error
// EnvKeysForScope returns environment variables for a version in the given scope
// It creates symlinks if needed and returns env vars with paths pointing to symlinks
EnvKeysForScope(version Version, scope env.UseScope) (*env.Envs, error)
Close()
}
Sdk interface defines the methods for managing software development kits (SDKs).
type SdkEnvs ¶ added in v1.0.0
type SdkEnvs []*SdkEnv
func (*SdkEnvs) ToExportEnvs ¶ added in v1.0.0
type VersionNotExistsError ¶ added in v1.0.0
type VersionNotExistsError struct {
Label string
}
func (*VersionNotExistsError) Error ¶ added in v1.0.0
func (e *VersionNotExistsError) Error() string
Click to show internal directories.
Click to hide internal directories.