Documentation
¶
Overview ¶
Package plugins implements a builtin controller that fetches a plugin registry index and presents each available plugin as a configurable entity. Enabled plugins are run as isolated subprocesses.
The index is loaded from index.json next to the executable first, falling back to the upstream GitHub copy.
Index ¶
Constants ¶
const RegistryURL = "https://raw.githubusercontent.com/projectqai/hydris/main/index.json"
RegistryURL is the raw GitHub URL used as a fallback when no local index.json exists next to the executable.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PluginIndex ¶
type PluginIndex struct {
HydrisVersion string `json:"hydris_version"`
Plugins []PluginInfo `json:"plugins"`
}
PluginIndex is the top-level structure of index.json.
func FetchIndex ¶
func FetchIndex(ctx context.Context) (*PluginIndex, error)
FetchIndex tries to read index.json from the directory containing the running executable. If that file does not exist or cannot be parsed, it falls back to fetching the index from GitHub.
func FetchRemoteIndexFromURL ¶
func FetchRemoteIndexFromURL(ctx context.Context, url, token string) (*PluginIndex, error)
FetchRemoteIndexFromURL fetches and parses an index.json from the given URL. If token is non-empty it is sent as a Bearer Authorization header.
type PluginInfo ¶
type PluginInfo struct {
Name string `json:"name"`
Ref string `json:"ref"`
Label string `json:"label"`
Description string `json:"description"`
Icon string `json:"icon,omitempty"`
Compat string `json:"compat,omitempty"` // semver range for hydris version compatibility
}
PluginInfo describes a single plugin in the registry.