uplugin

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

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

func (l *PluginLoader) Load(object string, hookName string) (plugin.Symbol, error)

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

func (*PluginLoader) Plugins

func (l *PluginLoader) Plugins(ext string) ([]string, error)

nolint gosec Plugins lists all the files in the ObjPlugins

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL