Documentation
¶
Index ¶
- func BuildProtocol(opt *ProtocolOption) caller.Builder
- type GoPlugin
- type Option
- func WithCustomConfigChecker(adapters ...discover.Checker) Option
- func WithCustomConfigParser(parserAdapter discover.Parser, sourceAdapter discover.SourceReader) Option
- func WithCustomIdentityChecker(adapter host.IdentityChecker) Option
- func WithCustomProcess(runner process.Runner, processes process.ProcessesBuilder) Option
- type PluginConf
- type PluginMapper
- type ProtocolOption
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildProtocol ¶
func BuildProtocol(opt *ProtocolOption) caller.Builder
BuildProtocol a helper to check and also generate a default protocol should be used like a REST or GRPC
Types ¶
type GoPlugin ¶
type GoPlugin struct {
// contains filtered or unexported fields
}
GoPlugin used as main struct to store goplugin's state
func New ¶
New used to create new instance of GoPlugin, you can provide customization here by giving goplugin.Option
func (*GoPlugin) Build ¶
Build used to compile current host instance into consumed state of host.Builder
func (*GoPlugin) GetPluginConf ¶
func (g *GoPlugin) GetPluginConf(pluginName string) (*PluginConf, error)
GetPluginConf used to get plugin's config
func (*GoPlugin) GetProcessInstance ¶
GetProcessInstance .
func (*GoPlugin) SetupPlugin ¶
func (g *GoPlugin) SetupPlugin(plugins ...PluginMapper) *GoPlugin
SetupPlugin used to store host plugin's configurations
type Option ¶
type Option func(*GoPlugin)
Option used to customize default objects
func WithCustomConfigChecker ¶
WithCustomConfigChecker used to customize config checker, the parameter must be implement discover.Checker
func WithCustomConfigParser ¶
func WithCustomConfigParser(parserAdapter discover.Parser, sourceAdapter discover.SourceReader) Option
WithCustomConfigParser used to customize config reader & parser, given adapters must be implement discover.Parser and discover.SourceReader interfaces
func WithCustomIdentityChecker ¶
func WithCustomIdentityChecker(adapter host.IdentityChecker) Option
WithCustomIdentityChecker used to customize plugin's identity checker, given adapter must implement host.IdentityChecker
func WithCustomProcess ¶
func WithCustomProcess(runner process.Runner, processes process.ProcessesBuilder) Option
WithCustomProcess used to customize process runner and process data builder (including registry)
type PluginConf ¶
type PluginConf struct {
Protocol *ProtocolOption
}
PluginConf used to store plugin's configurations
type PluginMapper ¶
type PluginMapper map[string]*PluginConf
PluginMapper used as registry to store plugin's config
func Map ¶
func Map(pluginName string, conf *PluginConf) PluginMapper
Map used to put a plugin and assign it with their spesific configurations
type ProtocolOption ¶
type ProtocolOption struct {
RESTOpts *driver.RESTOptions
GRPCOpts *driver.GrpcOptions
}
ProtocolOption used to configure rest or grpc options You have to choose between rest or grpc, if your plugin using rest, than ignore grpc option, and vice versa, but you can't ignore them both
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry used as wrapper of executor object
func (*Registry) Get ¶
Get plugin's instance. If plugin not started yet, this step will also run the plugin via os subprocess, before using this method you have to make sure that all hosts has been installed
func (*Registry) KillPlugins ¶
func (r *Registry) KillPlugins()
KillPlugins used to kill all plugins from all installed hosts