Documentation
¶
Index ¶
- Constants
- func DownloadFile(filepath string, url string) error
- func VerifyIntegrity(pluginPath, expectedChecksum string) error
- func VerifySignature(data []byte, signature []byte) error
- type BinaryRunner
- type Git
- type Host
- func (h *Host) Discover(ctx context.Context) ([]string, error)
- func (h *Host) GetManifest(pluginPath string) (*sdk.Manifest, bool)
- func (h *Host) GetPluginInfo(pluginPath string) (*PluginInfo, bool)
- func (h *Host) Handshake(ctx context.Context, pluginPath string) (*rpc.HandshakeResponse, error)
- func (h *Host) Lockfile() *registry.Lockfile
- func (h *Host) RunCheck(ctx context.Context, pluginPath string, checkID string) (*rpc.RunCheckResponse, error)
- type JavaRunner
- type NodeRunner
- type PluginInfo
- type PythonRunner
- type Registry
- func (r *Registry) CheckAndUpdateAll(ctx context.Context, host *Host, mode string) error
- func (r *Registry) FetchIndex(ctx context.Context) (*registry.Index, error)
- func (r *Registry) GetInfo(ctx context.Context, name string) (*registry.PluginMetadata, error)
- func (r *Registry) Install(ctx context.Context, pluginName string, host *Host) error
- func (r *Registry) PerformAtomicUpdate(ctx context.Context, name string, host *Host, meta *registry.PluginMetadata) error
- func (r *Registry) Search(ctx context.Context, query string) ([]registry.PluginMetadata, error)
- type Runner
- type RunnerRegistry
Constants ¶
const RegistryRootKey = `` /* 174-byte string literal not displayed */
RegistryRootKey is the pinned public key for the ZTVS Registry. In a production build, this would be a real ECDSA public key.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
func VerifyIntegrity ¶
VerifyIntegrity checks if the plug binary's SHA-256 hash matches the provided checksum. checksum should be in format "f2416982..." or "sha256:f2416982..."
func VerifySignature ¶
VerifySignature validates that the provided data was signed by the RegistryRootKey.
Types ¶
type BinaryRunner ¶
type BinaryRunner struct{}
BinaryRunner executes native binaries (Go, Rust).
func (*BinaryRunner) Name ¶
func (r *BinaryRunner) Name() string
func (*BinaryRunner) Supports ¶
func (r *BinaryRunner) Supports(runtimeType string) bool
func (*BinaryRunner) Validate ¶
func (r *BinaryRunner) Validate(entrypoint string) error
type Git ¶
type Git struct{}
Git handles git operations for plugin distribution.
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
func (*Host) GetPluginInfo ¶
func (h *Host) GetPluginInfo(pluginPath string) (*PluginInfo, bool)
type JavaRunner ¶
type JavaRunner struct{}
JavaRunner is a placeholder for Java support.
func (*JavaRunner) Name ¶
func (r *JavaRunner) Name() string
func (*JavaRunner) Supports ¶
func (r *JavaRunner) Supports(runtimeType string) bool
func (*JavaRunner) Validate ¶
func (r *JavaRunner) Validate(entrypoint string) error
type NodeRunner ¶
type NodeRunner struct{}
NodeRunner is a placeholder for Node.js support.
func (*NodeRunner) Name ¶
func (r *NodeRunner) Name() string
func (*NodeRunner) Supports ¶
func (r *NodeRunner) Supports(runtimeType string) bool
func (*NodeRunner) Validate ¶
func (r *NodeRunner) Validate(entrypoint string) error
type PluginInfo ¶
type PythonRunner ¶
type PythonRunner struct{}
PythonRunner is a placeholder for Python support.
func (*PythonRunner) Name ¶
func (r *PythonRunner) Name() string
func (*PythonRunner) Supports ¶
func (r *PythonRunner) Supports(runtimeType string) bool
func (*PythonRunner) Validate ¶
func (r *PythonRunner) Validate(entrypoint string) error
type Registry ¶
type Registry struct {
BaseURL string
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) CheckAndUpdateAll ¶
func (*Registry) FetchIndex ¶
func (*Registry) Install ¶
Install downloads, builds, and registers a plugin. It clones the monorepo to a temp dir, extracts the plugin subdirectory, builds it, and moves it to the final install location.
func (*Registry) PerformAtomicUpdate ¶
type Runner ¶
type Runner interface {
Name() string
Supports(runtimeType string) bool
Validate(entrypoint string) error
Execute(ctx context.Context, entrypoint string, stdin []byte) ([]byte, error)
}
Runner defines the interface for different plugin execution environments.
type RunnerRegistry ¶
type RunnerRegistry struct {
// contains filtered or unexported fields
}
RunnerRegistry manages the available plugin runners.
func NewRunnerRegistry ¶
func NewRunnerRegistry() *RunnerRegistry
func (*RunnerRegistry) GetRunner ¶
func (r *RunnerRegistry) GetRunner(runtimeType string) (Runner, error)
func (*RunnerRegistry) Register ¶
func (r *RunnerRegistry) Register(runner Runner)