Documentation
¶
Index ¶
- Constants
- Variables
- type AvailableHookCtx
- type AvailableHookResultItem
- type CheckSum
- type EnvKeysHookCtx
- type EnvKeysHookResultItem
- type HookFunc
- type Info
- type Location
- type Package
- type ParseLegacyFileHookCtx
- type ParseLegacyFileResult
- type Plugin
- type PluginInfo
- type PostInstallHookCtx
- type PreInstallHookCtx
- type PreInstallHookResult
- type PreInstallHookResultAdditionItem
- type PreUninstallHookCtx
- type PreUseHookCtx
- type PreUseHookResult
- type RuntimeInfo
- type UseScope
- type Version
Constants ¶
View Source
const ( PluginObjKey = "PLUGIN" OsType = "OS_TYPE" ArchType = "ARCH_TYPE" Runtime = "RUNTIME" )
Variables ¶
View Source
var ErrNoResultProvide = errors.New("no result provided")
View Source
var ErrNoVersionProvided = errors.New("no version number provided")
View Source
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"}, "ParseLegacyFile": {Name: "ParseLegacyFile", Required: false, Filename: "parse_legacy_file"}, "PreUninstall": {Name: "PreUninstall", Required: false, Filename: "pre_uninstall"}, } )
Functions ¶
This section is empty.
Types ¶
type AvailableHookCtx ¶
type AvailableHookCtx struct {
Args []string `json:"args"`
}
type AvailableHookResultItem ¶
type CheckSum ¶
type EnvKeysHookCtx ¶
type EnvKeysHookResultItem ¶
type Info ¶
type Info struct {
Name string `json:"name"`
Version string `json:"version"`
Path string `json:"path"`
Headers map[string]string `json:"headers"`
Note string `json:"note"`
Checksum *util.Checksum
}
func (*Info) StoragePath ¶
type ParseLegacyFileHookCtx ¶
type ParseLegacyFileResult ¶
type ParseLegacyFileResult struct {
Version Version `json:"version"`
}
type Plugin ¶
type Plugin interface {
Available(ctx *AvailableHookCtx) ([]*AvailableHookResultItem, error)
PreInstall(ctx *PreInstallHookCtx) (*PreInstallHookResult, error)
PostInstall(ctx *PostInstallHookCtx) error
PreUninstall(ctx *PreUninstallHookCtx) error
PreUse(ctx *PreUseHookCtx) (*PreUseHookResult, error)
ParseLegacyFile(ctx *ParseLegacyFileHookCtx) (*ParseLegacyFileResult, error)
EnvKeys(ctx *EnvKeysHookCtx) ([]*EnvKeysHookResultItem, error)
HasFunction(name string) bool
Close()
}
type PluginInfo ¶
type PluginInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
UpdateUrl string `json:"updateUrl"`
ManifestUrl string `json:"manifestUrl"`
Homepage string `json:"homepage"`
License string `json:"license"`
MinRuntimeVersion string `json:"minRuntimeVersion"`
Notes []string `json:"notes"`
LegacyFilenames []string `json:"legacyFilenames"`
}
type PostInstallHookCtx ¶
type PreInstallHookCtx ¶
type PreInstallHookCtx struct {
Version string `json:"version"`
}
type PreInstallHookResult ¶
type PreInstallHookResult struct {
Version string `json:"version"`
Url string `json:"url"`
Headers map[string]string `json:"headers"`
Note string `json:"note"`
Sha256 string `json:"sha256"`
Sha512 string `json:"sha512"`
Sha1 string `json:"sha1"`
Md5 string `json:"md5"`
Addition []*PreInstallHookResultAdditionItem `json:"addition"`
}
func (*PreInstallHookResult) Info ¶
func (i *PreInstallHookResult) Info() (*Info, error)
type PreInstallHookResultAdditionItem ¶
type PreInstallHookResultAdditionItem struct {
Name string `json:"name"`
Url string `json:"url"`
Headers map[string]string `json:"headers"`
Note string `json:"note"`
Sha256 string `json:"sha256"`
Sha512 string `json:"sha512"`
Sha1 string `json:"sha1"`
Md5 string `json:"md5"`
}
func (*PreInstallHookResultAdditionItem) Info ¶
func (i *PreInstallHookResultAdditionItem) Info() *Info
type PreUninstallHookCtx ¶
type PreUseHookCtx ¶
type PreUseHookResult ¶
type PreUseHookResult struct {
Version Version `json:"version"`
}
type RuntimeInfo ¶
type RuntimeInfo struct {
OsType string `json:"osType"`
ArchType string `json:"archType"`
Version string `json:"version"`
PluginDirPath string `json:"pluginDirPath"`
}
RuntimeInfo represents the runtime information of the current exec environment.
Click to show internal directories.
Click to hide internal directories.