Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TempDir string
TempDir is the base directory for temporary plugin extractions. Empty string uses the OS default. On Android this must be set to a writable directory (e.g. the app's cache dir) before calling ResolveOCI.
Functions ¶
func CheckHydrisVersion ¶
CheckHydrisVersion validates the given hydris version against the engines.hydris semver range from package.json.
func ResolveOCI ¶
func ResolveOCI(ref string, hydrisVersion string) (bundlePath, dataDir string, cleanup func(), err error)
ResolveOCI pulls an OCI image, extracts the plugin layer, checks version constraints and returns the path to the bundle and its data directory. The caller must call cleanup when done to remove the temp directory.
Types ¶
type Package ¶
type Package struct {
Name string `json:"name"`
Version string `json:"version"`
Main string `json:"main"`
Files []string `json:"files,omitempty"`
Hydris *struct {
Compat string `json:"compat,omitempty"`
} `json:"hydris,omitempty"`
}
Package mirrors the relevant fields of a plugin's package.json.
func ReadPackageJSON ¶
ReadPackageJSON reads and parses a package.json from dir.
Click to show internal directories.
Click to hide internal directories.