Documentation
¶
Index ¶
- Constants
- type PluginLoader
- func (l *PluginLoader) Compile(name string) (string, error)
- func (l *PluginLoader) Invoke(sym plugin.Symbol, params ...interface{}) ([]interface{}, error)
- func (l *PluginLoader) Load(object string, hookName string) (plugin.Symbol, error)
- func (l *PluginLoader) LoadAndInvoke(plugin, method string, params ...interface{}) ([]interface{}, error)
- func (l *PluginLoader) Plugins(ext string) ([]string, error)
Constants ¶
View Source
const ( //SourceExt const SourceExt = ".go" //CompiledExt const CompiledExt = ".so" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PluginLoader ¶
type PluginLoader struct {
// contains filtered or unexported fields
}
PluginLoader keeps the context needed to find where ObjPlugins and objects are stored.
func NewPluginLoader ¶
func NewPluginLoader(sourcePath, objPath string) *PluginLoader
NewPluginLoader return new plugin loader object with src and compiled folders
func (*PluginLoader) Compile ¶
func (l *PluginLoader) Compile(name string) (string, error)
Compile the go plugin in a given path and hook name and return it symbol
func (*PluginLoader) Invoke ¶ added in v0.0.2
func (l *PluginLoader) Invoke(sym plugin.Symbol, params ...interface{}) ([]interface{}, error)
Invoke invoke plugin function with params and return it results
func (*PluginLoader) Load ¶
Load loads the plugin object in the given path and runs the Run function.
func (*PluginLoader) LoadAndInvoke ¶ added in v0.0.2
func (l *PluginLoader) LoadAndInvoke(plugin, method string, params ...interface{}) ([]interface{}, error)
LoadAndInvoke invoke plugin function with params and return it results
Click to show internal directories.
Click to hide internal directories.