Registry carried no plugin identity, discovery, compatibility or lifecycle, so it was never the seed for the approved internal/domain/plugin package. Host, Manifest and Module are, and they stay. Regenerating pluginextract strips the interface-wrapper nil guards, so those are restored by hand; the only intended change to the generated table is dropping the Registry symbol.
81 lines
2.6 KiB
Go
81 lines
2.6 KiB
Go
// Code generated by 'yaegi extract github.com/samcharles93/archie-core/internal/plugin'. DO NOT EDIT.
|
|
|
|
package pluginextract
|
|
|
|
import (
|
|
"context"
|
|
"github.com/samcharles93/archie-core/internal/plugin"
|
|
"go/constant"
|
|
"go/token"
|
|
"reflect"
|
|
)
|
|
|
|
func init() {
|
|
Symbols["github.com/samcharles93/archie-core/internal/plugin/plugin"] = map[string]reflect.Value{
|
|
// function, constant and variable definitions
|
|
"AdaptLegacy": reflect.ValueOf(plugin.AdaptLegacy),
|
|
"HostAPIVersion": reflect.ValueOf(constant.MakeFromLiteral("\"1.0.0\"", token.STRING, 0)),
|
|
"LoadDir": reflect.ValueOf(plugin.LoadDir),
|
|
"NewHost": reflect.ValueOf(plugin.NewHost),
|
|
|
|
// type definitions
|
|
"CapabilityKind": reflect.ValueOf((*plugin.CapabilityKind)(nil)),
|
|
"Host": reflect.ValueOf((*plugin.Host)(nil)),
|
|
"Manifest": reflect.ValueOf((*plugin.Manifest)(nil)),
|
|
"Module": reflect.ValueOf((*plugin.Module)(nil)),
|
|
"Permission": reflect.ValueOf((*plugin.Permission)(nil)),
|
|
"Plugin": reflect.ValueOf((*plugin.Plugin)(nil)),
|
|
|
|
// interface wrapper definitions
|
|
"_Module": reflect.ValueOf((*_github_com_samcharles93_archie_core_internal_plugin_Module)(nil)),
|
|
"_Plugin": reflect.ValueOf((*_github_com_samcharles93_archie_core_internal_plugin_Plugin)(nil)),
|
|
}
|
|
}
|
|
|
|
// _github_com_samcharles93_archie_core_internal_plugin_Module is an interface wrapper for Module type
|
|
type _github_com_samcharles93_archie_core_internal_plugin_Module struct {
|
|
IValue interface{}
|
|
WManifest func() plugin.Manifest
|
|
WStart func(a0 context.Context) error
|
|
WStop func(a0 context.Context) error
|
|
}
|
|
|
|
func (W _github_com_samcharles93_archie_core_internal_plugin_Module) Manifest() plugin.Manifest {
|
|
if W.WManifest == nil {
|
|
return plugin.Manifest{}
|
|
}
|
|
return W.WManifest()
|
|
}
|
|
func (W _github_com_samcharles93_archie_core_internal_plugin_Module) Start(a0 context.Context) error {
|
|
if W.WStart == nil {
|
|
return nil
|
|
}
|
|
return W.WStart(a0)
|
|
}
|
|
func (W _github_com_samcharles93_archie_core_internal_plugin_Module) Stop(a0 context.Context) error {
|
|
if W.WStop == nil {
|
|
return nil
|
|
}
|
|
return W.WStop(a0)
|
|
}
|
|
|
|
// _github_com_samcharles93_archie_core_internal_plugin_Plugin is an interface wrapper for Plugin type
|
|
type _github_com_samcharles93_archie_core_internal_plugin_Plugin struct {
|
|
IValue interface{}
|
|
WName func() string
|
|
WVersion func() string
|
|
}
|
|
|
|
func (W _github_com_samcharles93_archie_core_internal_plugin_Plugin) Name() string {
|
|
if W.WName == nil {
|
|
return ""
|
|
}
|
|
return W.WName()
|
|
}
|
|
func (W _github_com_samcharles93_archie_core_internal_plugin_Plugin) Version() string {
|
|
if W.WVersion == nil {
|
|
return ""
|
|
}
|
|
return W.WVersion()
|
|
}
|