Documentation
¶
Index ¶
- func SetupLocalPlugins(plugins map[string]LocalDescriptor) error
- func SetupRemotePlugins(manager *Manager, plugins map[string]Descriptor) error
- type Builder
- type Constructor
- type ContextApplier
- type Descriptor
- type LocalDescriptor
- type Manager
- func (m *Manager) CleanArchives(plugins map[string]Descriptor) error
- func (m *Manager) GoPath() string
- func (m *Manager) InstallPlugin(ctx context.Context, plugin Descriptor) error
- func (m *Manager) ReadManifest(moduleName string) (*Manifest, error)
- func (m *Manager) ResetAll() error
- func (m *Manager) WriteState(plugins map[string]Descriptor) error
- type ManagerOptions
- type Manifest
- type PP
- type PluginDownloader
- type Provider
- type RegistryDownloader
- type RegistryDownloaderOptions
- type Settings
- type WasmMiddleware
- type YaegiMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupLocalPlugins ¶
func SetupLocalPlugins(plugins map[string]LocalDescriptor) error
SetupLocalPlugins setup local plugins environment.
func SetupRemotePlugins ¶
func SetupRemotePlugins(manager *Manager, plugins map[string]Descriptor) error
SetupRemotePlugins setup remote plugins environment.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is a plugin builder.
func NewBuilder ¶
func NewBuilder(manager *Manager, plugins map[string]Descriptor, localPlugins map[string]LocalDescriptor) (*Builder, error)
NewBuilder creates a new Builder.
type Constructor ¶
Constructor creates a plugin handler.
type ContextApplier ¶
func InstantiateHost ¶
func InstantiateHost(ctx context.Context, runtime wazero.Runtime, mod wazero.CompiledModule, settings Settings) (ContextApplier, error)
InstantiateHost instantiates the Host module according to the guest requirements (for now only SocketExtensions).
type Descriptor ¶
type Descriptor struct {
// ModuleName (required)
ModuleName string `` /* 133-byte string literal not displayed */
// Version (required)
Version string `description:"plugin's version." json:"version,omitempty" toml:"version,omitempty" yaml:"version,omitempty" export:"true"`
// Hash (optional)
Hash string `description:"plugin's hash to validate'" json:"hash,omitempty" toml:"hash,omitempty" yaml:"hash,omitempty" export:"true"`
// Settings (optional)
Settings Settings `` /* 154-byte string literal not displayed */
}
Descriptor The static part of a plugin configuration.
type LocalDescriptor ¶
type LocalDescriptor struct {
// ModuleName (required)
ModuleName string `` /* 133-byte string literal not displayed */
// Settings (optional)
Settings Settings `` /* 154-byte string literal not displayed */
}
LocalDescriptor The static part of a local plugin configuration.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages Ingress plugins lifecycle operations including storage, and manifest reading.
func NewManager ¶
func NewManager(downloader PluginDownloader, opts ManagerOptions) (*Manager, error)
NewManager creates a new Ingress plugins manager.
func (*Manager) CleanArchives ¶
func (m *Manager) CleanArchives(plugins map[string]Descriptor) error
CleanArchives cleans plugins archives.
func (*Manager) InstallPlugin ¶
func (m *Manager) InstallPlugin(ctx context.Context, plugin Descriptor) error
InstallPlugin download and unzip the given plugin.
func (*Manager) ReadManifest ¶
ReadManifest reads a plugin manifest.
func (*Manager) WriteState ¶
func (m *Manager) WriteState(plugins map[string]Descriptor) error
WriteState writes the plugins state files.
type ManagerOptions ¶
type ManagerOptions struct {
Output string
}
ManagerOptions the options of a Ingress plugins manager.
type Manifest ¶
type Manifest struct {
DisplayName string `yaml:"displayName"`
Type string `yaml:"type"`
Runtime string `yaml:"runtime"`
WasmPath string `yaml:"wasmPath"`
Import string `yaml:"import"`
BasePkg string `yaml:"basePkg"`
Compatibility string `yaml:"compatibility"`
Summary string `yaml:"summary"`
UseUnsafe bool `yaml:"useUnsafe"`
TestData map[string]any `yaml:"testData"`
}
Manifest The plugin manifest.
func ReadManifest ¶
ReadManifest reads a plugin manifest.
func (*Manifest) IsYaegiPlugin ¶
IsYaegiPlugin returns true if the plugin is a Yaegi plugin.
type PluginDownloader ¶
type PluginDownloader interface {
// Download downloads a plugin archive and returns its hash.
Download(ctx context.Context, pName, pVersion string) (string, error)
// Check checks the plugin archive integrity against a known hash.
Check(ctx context.Context, pName, pVersion, hash string) error
}
PluginDownloader defines the interface for downloading and validating plugins from remote sources.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a plugin's provider wrapper.
type RegistryDownloader ¶
type RegistryDownloader struct {
// contains filtered or unexported fields
}
RegistryDownloader implements PluginDownloader for HTTP-based plugin downloads.
func NewRegistryDownloader ¶
func NewRegistryDownloader(opts RegistryDownloaderOptions) (*RegistryDownloader, error)
NewRegistryDownloader creates a new HTTP-based plugin downloader.
type RegistryDownloaderOptions ¶
RegistryDownloaderOptions holds configuration options for creating a RegistryDownloader.
type WasmMiddleware ¶
type WasmMiddleware struct {
// contains filtered or unexported fields
}
WasmMiddleware is an HTTP handler plugin wrapper.
func (WasmMiddleware) NewHandler ¶
NewHandler creates a new HTTP handler.
type YaegiMiddleware ¶
type YaegiMiddleware struct {
// contains filtered or unexported fields
}
YaegiMiddleware is an HTTP handler plugin wrapper.
func (*YaegiMiddleware) NewHandler ¶
NewHandler creates a new HTTP handler.