Documentation ¶
Index ¶
- Constants
- func PluginId(namespace string, name string) string
- func StartPlugin(namespace string, plugin Plugin, logger comm.Logger) (err error)
- func StopPlugin(namespace string, plugin Plugin, logger comm.Logger) (err error)
- type BasePlugin
- type BasePluginLoader
- func (me BasePluginLoader) Namespace() string
- func (me BasePluginLoader) Plugins() map[string]Plugin
- func (me BasePluginLoader) Register(plugin Plugin)
- func (me BasePluginLoader) RegisterThenStart(logger comm.Logger, plugin Plugin)
- func (me BasePluginLoader) Start(logger comm.Logger) error
- func (me BasePluginLoader) Stop(logger comm.Logger) error
- type BasePluginLoaderT
- type BasePluginT
- type ExternalGoPluginContext
- func (me ExternalGoPluginContext) GetStartFunc() *reflect.Value
- func (me ExternalGoPluginContext) GetStopFunc() *reflect.Value
- func (me ExternalGoPluginContext) Init(logger comm.Logger, fs afero.Fs, codeFile string)
- func (me ExternalGoPluginContext) Start() any
- func (me ExternalGoPluginContext) Stop() any
- type ExternalGoPluginContextT
- type ExternalPlugin
- func (me ExternalPlugin) CodeFile() string
- func (me ExternalPlugin) Dir() string
- func (me ExternalPlugin) IsStarted() bool
- func (me ExternalPlugin) Kind() PluginKind
- func (me ExternalPlugin) Language() string
- func (me ExternalPlugin) Name() string
- func (me ExternalPlugin) Start(logger comm.Logger)
- func (me ExternalPlugin) Stop(logger comm.Logger)
- func (me ExternalPlugin) Version() (major int, minor int)
- type ExternalPluginContext
- type ExternalPluginT
- type FsPluginLoader
- type FsPluginLoaderT
- type Plugin
- type PluginKind
- type PluginLang
- type PluginLoader
- type PluginManifest
- type PluginManifestT
- type PluginRegistry
- func (me PluginRegistry) ByKind(kind PluginKind) map[string]Plugin
- func (me PluginRegistry) Destroy(logger comm.Logger)
- func (me PluginRegistry) HasNamespace(ns string) bool
- func (me PluginRegistry) Init(logger comm.Logger)
- func (me PluginRegistry) IsSupportedPluginKind(kind PluginKind) bool
- func (me PluginRegistry) Register(loader PluginLoader)
- func (me PluginRegistry) SupportedMajorVersion() int
- func (me PluginRegistry) ValidatePlugin(namespace string, plugin Plugin) error
- type PluginRegistryT
Constants ¶
View Source
const ( PLUGIN_LANG_GO = "go" PLUGIN_LANG_JAVASCRIPT = "javascript" PLUGIN_LANG_SHELL = "shell" )
Variables ¶
This section is empty.
Functions ¶
func StartPlugin ¶
func StopPlugin ¶
Types ¶
type BasePlugin ¶
type BasePlugin = *BasePluginT
func (BasePlugin) IsStarted ¶
func (me BasePlugin) IsStarted() bool
func (BasePlugin) Kind ¶
func (me BasePlugin) Kind() PluginKind
func (BasePlugin) Name ¶
func (me BasePlugin) Name() string
func (BasePlugin) Start ¶
func (me BasePlugin) Start(logger comm.Logger)
func (BasePlugin) Stop ¶
func (me BasePlugin) Stop(logger comm.Logger)
func (BasePlugin) Version ¶
func (me BasePlugin) Version() (major int, minor int)
type BasePluginLoader ¶
type BasePluginLoader = *BasePluginLoaderT
func NewPluginLoader ¶
func NewPluginLoader(namespace string) BasePluginLoader
func (BasePluginLoader) Namespace ¶
func (me BasePluginLoader) Namespace() string
func (BasePluginLoader) Plugins ¶
func (me BasePluginLoader) Plugins() map[string]Plugin
func (BasePluginLoader) Register ¶
func (me BasePluginLoader) Register(plugin Plugin)
func (BasePluginLoader) RegisterThenStart ¶
func (me BasePluginLoader) RegisterThenStart(logger comm.Logger, plugin Plugin)
func (BasePluginLoader) Start ¶
func (me BasePluginLoader) Start(logger comm.Logger) error
func (BasePluginLoader) Stop ¶
func (me BasePluginLoader) Stop(logger comm.Logger) error
type BasePluginLoaderT ¶
type BasePluginLoaderT struct {
// contains filtered or unexported fields
}
type BasePluginT ¶
type BasePluginT struct {
// contains filtered or unexported fields
}
func NewBasePlugin ¶
func NewBasePlugin(name string, kind PluginKind) BasePluginT
type ExternalGoPluginContext ¶
type ExternalGoPluginContext = *ExternalGoPluginContextT
func NewExternalGoPluginContext ¶
func NewExternalGoPluginContext() ExternalGoPluginContext
func (ExternalGoPluginContext) GetStartFunc ¶
func (me ExternalGoPluginContext) GetStartFunc() *reflect.Value
func (ExternalGoPluginContext) GetStopFunc ¶
func (me ExternalGoPluginContext) GetStopFunc() *reflect.Value
func (ExternalGoPluginContext) Init ¶
func (me ExternalGoPluginContext) Init(logger comm.Logger, fs afero.Fs, codeFile string)
func (ExternalGoPluginContext) Start ¶
func (me ExternalGoPluginContext) Start() any
func (ExternalGoPluginContext) Stop ¶
func (me ExternalGoPluginContext) Stop() any
type ExternalGoPluginContextT ¶
type ExternalGoPluginContextT struct {
// contains filtered or unexported fields
}
type ExternalPlugin ¶
type ExternalPlugin = *ExternalPluginT
func ListExternalPlugins ¶
func ListExternalPlugins(logger comm.Logger, afs afero.Fs, baseDir string) []ExternalPlugin
func ResolveExternalPlugin ¶
func ResolveExternalPlugin(logger comm.Logger, fs afero.Fs, pluginDir string) (result ExternalPlugin)
func (ExternalPlugin) CodeFile ¶
func (me ExternalPlugin) CodeFile() string
func (ExternalPlugin) Dir ¶
func (me ExternalPlugin) Dir() string
func (ExternalPlugin) IsStarted ¶
func (me ExternalPlugin) IsStarted() bool
func (ExternalPlugin) Kind ¶
func (me ExternalPlugin) Kind() PluginKind
func (ExternalPlugin) Language ¶
func (me ExternalPlugin) Language() string
func (ExternalPlugin) Name ¶
func (me ExternalPlugin) Name() string
func (ExternalPlugin) Start ¶
func (me ExternalPlugin) Start(logger comm.Logger)
func (ExternalPlugin) Stop ¶
func (me ExternalPlugin) Stop(logger comm.Logger)
func (ExternalPlugin) Version ¶
func (me ExternalPlugin) Version() (major int, minor int)
type ExternalPluginContext ¶
type ExternalPluginT ¶
type ExternalPluginT struct {
// contains filtered or unexported fields
}
type FsPluginLoader ¶
type FsPluginLoader = *FsPluginLoaderT
func (FsPluginLoader) Start ¶
func (me FsPluginLoader) Start(logger comm.Logger) error
type FsPluginLoaderT ¶
type FsPluginLoaderT struct { BasePluginLoaderT // contains filtered or unexported fields }
type Plugin ¶
type Plugin interface { Name() string Kind() PluginKind Start(logger comm.Logger) Stop(logger comm.Logger) Version() (major int, minor int) }
type PluginKind ¶
type PluginKind = string
type PluginLang ¶
type PluginLang = string
type PluginLoader ¶
type PluginLoader interface { Namespace() string Plugins() map[string]Plugin Start(logger comm.Logger) error Stop(logger comm.Logger) error }
func NewFsPluginLoader ¶
func NewFsPluginLoader(logger comm.Logger, fs afero.Fs, dir string, namespace string) PluginLoader
func NewLocalPluginLoader ¶
func NewLocalPluginLoader(logger comm.Logger, fs afero.Fs, dir string) PluginLoader
func NewRemotePluginLoader ¶
func NewRemotePluginLoader(logger comm.Logger, fs afero.Fs, dir string) PluginLoader
type PluginManifest ¶
type PluginManifest = *PluginManifestT
func PluginManifestWithJsonFile ¶
func PluginManifestWithJsonFile(fs afero.Fs, manifestJsonFile string) PluginManifest
func PluginManifestWithMap ¶
func PluginManifestWithMap(manifestMap map[string]any) PluginManifest
func PluginManifestWithYamlFile ¶
func PluginManifestWithYamlFile(fs afero.Fs, manifestYamlFile string) PluginManifest
type PluginManifestT ¶
type PluginManifestT struct { Kind PluginKind `mapstructure:"kind" yaml:"kind"` Name string `mapstructure:"name" yaml:"name"` VersionMajor int `mapstructure:"version_major" yaml:"version_major"` VersionMinor int `mapstructure:"version_minor" yaml:"version_minor"` }
type PluginRegistry ¶
type PluginRegistry = *PluginRegistryT
func NewPluginRegistry ¶
func NewPluginRegistry(supportedMajorVersion int, supportedKinds ...PluginKind) PluginRegistry
func (PluginRegistry) ByKind ¶
func (me PluginRegistry) ByKind(kind PluginKind) map[string]Plugin
func (PluginRegistry) Destroy ¶
func (me PluginRegistry) Destroy(logger comm.Logger)
func (PluginRegistry) HasNamespace ¶
func (me PluginRegistry) HasNamespace(ns string) bool
func (PluginRegistry) Init ¶
func (me PluginRegistry) Init(logger comm.Logger)
func (PluginRegistry) IsSupportedPluginKind ¶
func (me PluginRegistry) IsSupportedPluginKind(kind PluginKind) bool
func (PluginRegistry) Register ¶
func (me PluginRegistry) Register(loader PluginLoader)
func (PluginRegistry) SupportedMajorVersion ¶
func (me PluginRegistry) SupportedMajorVersion() int
func (PluginRegistry) ValidatePlugin ¶
func (me PluginRegistry) ValidatePlugin(namespace string, plugin Plugin) error
type PluginRegistryT ¶
type PluginRegistryT struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.