plugin

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

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

func CheckHydrisVersion(pkg *Package, hydrisVersion string) error

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

func ReadPackageJSON(dir string) (*Package, error)

ReadPackageJSON reads and parses a package.json from dir.

Jump to

Keyboard shortcuts

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