Documentation ¶
Index ¶
- Constants
- Variables
- type Arg
- type AvailableHookCtx
- type AvailableHookResult
- type AvailableHookResultItem
- type Checksum
- type EnvKeysHookCtx
- type EnvKeysHookResultItem
- type HookFunc
- type Info
- type LuaCheckSum
- type LuaPlugin
- func (l *LuaPlugin) Available(args []string) ([]*Package, error)
- func (l *LuaPlugin) CallFunction(funcName string, args ...lua.LValue) error
- func (l *LuaPlugin) Close()
- func (l *LuaPlugin) EnvKeys(sdkPackage *Package) (*env.Envs, error)
- func (l *LuaPlugin) HasFunction(name string) bool
- func (l *LuaPlugin) Label(version string) string
- func (l *LuaPlugin) PostInstall(rootPath string, sdks []*Info) error
- func (l *LuaPlugin) PreInstall(version Version) (*Package, error)
- func (l *LuaPlugin) PreUse(version Version, previousVersion Version, scope UseScope, cwd string, ...) (Version, error)
- func (l *LuaPlugin) Validate() error
- type LuaPluginInfo
- type LuaRuntime
- type Manager
- func (m *Manager) Add(pluginName, url, alias string) error
- func (m *Manager) Available() (RegistryIndex, error)
- func (m *Manager) CleanTmp()
- func (m *Manager) Close()
- func (m *Manager) EnvKeys(tvs toolset.MultiToolVersions) (*env.Envs, error)
- func (m *Manager) GetRegistryAddress(uri string) string
- func (m *Manager) HttpClient() *http.Client
- func (m *Manager) LoadAllSdk() (map[string]*Sdk, error)
- func (m *Manager) LookupSdk(name string) (*Sdk, error)
- func (m *Manager) LookupSdkWithInstall(name string) (*Sdk, error)
- func (m *Manager) Remove(pluginName string) error
- func (m *Manager) Update(pluginName string) error
- type NotFoundError
- type Package
- type PathMeta
- type PostInstallHookCtx
- type PreInstallHookCtx
- type PreInstallHookResult
- type PreInstallHookResultAdditionItem
- type PreUseHookCtx
- type PreUseHookResult
- type RegistryIndex
- type RegistryIndexItem
- type RegistryPluginManifest
- type Sdk
- func (b *Sdk) Available(args []string) ([]*Package, error)
- func (b *Sdk) Close()
- func (b *Sdk) Current() Version
- func (b *Sdk) Download(u *url.URL) (string, error)
- func (b *Sdk) EnvKeys(version Version) (*env.Envs, error)
- func (b *Sdk) Install(version Version) error
- func (b *Sdk) List() []Version
- func (b *Sdk) PreUse(version Version, scope UseScope) (Version, error)
- func (b *Sdk) Uninstall(version Version) error
- func (b *Sdk) Use(version Version, scope UseScope) error
- func (b *Sdk) VersionPath(version Version) string
- type UseScope
- type Version
Constants ¶
const RuntimeVersion = "0.3.2"
Variables ¶
var ( // HookFuncMap is a map of built-in hook functions. HookFuncMap = map[string]HookFunc{ "Available": {Name: "Available", Required: true, Filename: "available"}, "PreInstall": {Name: "PreInstall", Required: true, Filename: "pre_install"}, "EnvKeys": {Name: "EnvKeys", Required: true, Filename: "env_keys"}, "PostInstall": {Name: "PostInstall", Required: false, Filename: "post_install"}, "PreUse": {Name: "PreUse", Required: false, Filename: "pre_use"}, } )
var NoneChecksum = &Checksum{
Value: "",
Type: "none",
}
Functions ¶
This section is empty.
Types ¶
type AvailableHookCtx ¶ added in v0.2.5
type AvailableHookCtx struct {
Args []string `luai:"args"`
}
type AvailableHookResult ¶ added in v0.2.5
type AvailableHookResult = []*AvailableHookResultItem
type AvailableHookResultItem ¶ added in v0.2.5
type EnvKeysHookCtx ¶ added in v0.2.5
type EnvKeysHookResultItem ¶ added in v0.2.5
type LuaCheckSum ¶ added in v0.2.5
type LuaCheckSum struct { Sha256 string `luai:"sha256"` Sha512 string `luai:"sha512"` Sha1 string `luai:"sha1"` Md5 string `luai:"md5"` }
func (*LuaCheckSum) Checksum ¶ added in v0.2.5
func (c *LuaCheckSum) Checksum() *Checksum
type LuaPlugin ¶
type LuaPlugin struct { // plugin source path Path string // plugin filename, this is also alias name, sdk-name SdkName string *LuaPluginInfo // contains filtered or unexported fields }
func NewLuaPlugin ¶
NewLuaPlugin creates a new LuaPlugin instance from the specified directory path. The plugin directory must meet one of the following conditions: - The directory must contain a metadata.lua file and a hooks directory that includes all must be implemented hook functions. - The directory contain a main.lua file that defines the plugin object and all hook functions.
func (*LuaPlugin) CallFunction ¶ added in v0.2.5
func (*LuaPlugin) HasFunction ¶ added in v0.2.5
func (*LuaPlugin) PostInstall ¶
type LuaPluginInfo ¶ added in v0.2.5
type LuaPluginInfo struct { Name string `luai:"name"` Version string `luai:"version"` Description string `luai:"description"` UpdateUrl string `luai:"updateUrl"` ManifestUrl string `luai:"manifestUrl"` Homepage string `luai:"homepage"` License string `luai:"license"` MinRuntimeVersion string `luai:"minRuntimeVersion"` Notes []string `luai:"notes"` }
type LuaRuntime ¶ added in v0.3.0
type LuaRuntime struct { OsType string `luai:"osType"` ArchType string `luai:"archType"` Version string `luai:"version"` PluginDirPath string `luai:"pluginDirPath"` }
LuaRuntime represents the runtime information of the Lua environment.
type Manager ¶
type Manager struct { PathMeta *PathMeta EnvManager env.Manager Config *config.Config // contains filtered or unexported fields }
func NewSdkManager ¶
func NewSdkManager() *Manager
func (*Manager) Available ¶
func (m *Manager) Available() (RegistryIndex, error)
func (*Manager) GetRegistryAddress ¶ added in v0.3.0
func (*Manager) HttpClient ¶ added in v0.3.2
func (*Manager) LookupSdkWithInstall ¶ added in v0.3.2
type NotFoundError ¶ added in v0.3.2
type NotFoundError struct {
Msg string
}
func (NotFoundError) Error ¶ added in v0.3.2
func (n NotFoundError) Error() string
type PostInstallHookCtx ¶ added in v0.2.5
type PreInstallHookCtx ¶ added in v0.2.5
type PreInstallHookCtx struct {
Version string `luai:"version"`
}
type PreInstallHookResult ¶ added in v0.2.5
type PreInstallHookResult struct { Version string `luai:"version"` Url string `luai:"url"` Note string `luai:"note"` Sha256 string `luai:"sha256"` Sha512 string `luai:"sha512"` Sha1 string `luai:"sha1"` Md5 string `luai:"md5"` Addition []*PreInstallHookResultAdditionItem `luai:"addition"` }
func (*PreInstallHookResult) Info ¶ added in v0.2.5
func (i *PreInstallHookResult) Info() (*Info, error)
type PreInstallHookResultAdditionItem ¶ added in v0.2.5
type PreInstallHookResultAdditionItem struct { Name string `luai:"name"` Url string `luai:"url"` Note string `luai:"note"` Sha256 string `luai:"sha256"` Sha512 string `luai:"sha512"` Sha1 string `luai:"sha1"` Md5 string `luai:"md5"` }
func (*PreInstallHookResultAdditionItem) Info ¶ added in v0.2.5
func (i *PreInstallHookResultAdditionItem) Info() *Info
type PreUseHookCtx ¶ added in v0.2.5
type PreUseHookResult ¶ added in v0.2.5
type PreUseHookResult struct {
Version string `luai:"version"`
}
type RegistryIndex ¶ added in v0.3.0
type RegistryIndex []*RegistryIndexItem
RegistryIndex is the index of the registry
type RegistryIndexItem ¶ added in v0.3.0
type RegistryIndexItem struct { Name string `json:"name"` Desc string `json:"desc"` Homepage string `json:"homepage"` }
RegistryIndexItem is the item in the registry index
type RegistryPluginManifest ¶ added in v0.3.0
type RegistryPluginManifest struct { Name string `json:"name"` Version string `json:"version"` License string `json:"license"` Author string `json:"author"` DownloadUrl string `json:"downloadUrl"` MinRuntimeVersion string `json:"minRuntimeVersion"` }
RegistryPluginManifest is the manifest of a remote plugin
type Sdk ¶
type Sdk struct { Plugin *LuaPlugin // current sdk install path InstallPath string // contains filtered or unexported fields }
func (*Sdk) Current ¶
Current returns the current version of the SDK. Lookup priority is: project > session > global