Documentation
¶
Index ¶
- type Engine
- func (e *Engine) CallExtensionFunc(ex gopdk.Extension, data []byte) ([]byte, error)
- func (e *Engine) GetExtensionsForExtensionPoint(epoint string, version *string) []*gopdk.Extension
- func (e *Engine) GetPlugins() map[string]map[string]*Plugin
- func (e *Engine) Load(path string) error
- func (e *Engine) RegisterHostExtensionPoint(id, name, version, description string)
- type Extension
- type ExtensionPoint
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewPluginEngine ¶
func NewPluginEngine(hostFuncs []extism.HostFunction) *Engine
NewPluginEngine
This function will create a new plugin engine instance. Passed in are host functions per the Extism (WASI) Host Function spec. This allows consumers of this engine to provide its own host functions that plugins will be able to utilize along with the plugin engine host functions.
func (*Engine) CallExtensionFunc ¶ added in v0.0.3
func (*Engine) GetExtensionsForExtensionPoint ¶ added in v0.0.3
GetExtensionsForExtensionPoint
This method will look for a matching endpoint in the map of endpoints and if found and the version provided is not nil, look for a matching version (TODO: version range may be added in future). If version is nil, the first extension point's extensions are returned.
func (*Engine) GetPlugins ¶ added in v0.0.3
func (*Engine) RegisterHostExtensionPoint ¶
RegisterHostExtensionPoint
This method allows a host/client application that is using the Plugin Engine to register extension points. This is useful if the host/client app has some specific things it wants to allow anchor points for plugins to attach to. Ideally a host/client app may ship/install/start with plugins already, but this gives the ability for the host/client to have native code functions tied to extension points that are then filled by plugin extensions.
type ExtensionPoint ¶
type ExtensionPoint struct {
types.ExtensionPoint
// Because this outer ExtensionPoint wrapper allows for host extension points, which are native to Go, a func pointer
// to call upon that extension point is necessary. This is not the typical wasm string func name to call, but an
// actual Go function provided by the host to be called
Func func([]*Extension) error
Extensions []*Extension
Plugin Plugin
}