plugin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncompatibleVersion = errors.New("incompatible hydris version")

ErrIncompatibleVersion is wrapped into the error CheckHydrisVersion returns when the running hydris is outside a plugin's engines.hydris range, so the run path can treat it as a conflict rather than a transient failure.

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 ExtractPluginTarGz added in v0.0.23

func ExtractPluginTarGz(r io.Reader) (string, error)

ExtractPluginTarGz extracts a gzip-compressed plugin tar into a temp dir, returning the directory path. The caller must remove the directory when done.

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.

func TestRegistryAuth added in v0.0.21

func TestRegistryAuth(registry, username, password string) error

TestRegistryAuth validates that the given credentials can authenticate against the registry by performing the full token exchange.

Types

type OCIImage added in v0.0.23

type OCIImage = v1.Image

OCIImage is a pulled OCI image (alias for v1.Image).

func PullOCIImage added in v0.0.23

func PullOCIImage(ref string) (OCIImage, error)

PullOCIImage pulls an OCI image from the remote registry with auth.

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