common

package
v0.0.0-...-2193aa2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallFunc

func CallFunc(fn reflect.Value, args ...interface{}) (interface{}, error)

CallFunc calls function with arguments

Types

type GoPlugin

type GoPlugin struct {
	*plugin.Plugin
	// contains filtered or unexported fields
}

GoPlugin implements golang official plugin

func (*GoPlugin) Call

func (p *GoPlugin) Call(funcName string, args ...interface{}) (interface{}, error)

func (*GoPlugin) Has

func (p *GoPlugin) Has(funcName string) bool

func (*GoPlugin) Init

func (p *GoPlugin) Init(path string) error

func (*GoPlugin) Quit

func (p *GoPlugin) Quit() error

type HashicorpPlugin

type HashicorpPlugin struct {
	pluginShared.FuncCaller
	// contains filtered or unexported fields
}

HashicorpPlugin implements hashicorp/go-plugin

func (*HashicorpPlugin) Call

func (p *HashicorpPlugin) Call(funcName string, args ...interface{}) (interface{}, error)

func (*HashicorpPlugin) Has

func (p *HashicorpPlugin) Has(funcName string) bool

func (*HashicorpPlugin) Init

func (p *HashicorpPlugin) Init(path string) error

func (*HashicorpPlugin) Quit

func (p *HashicorpPlugin) Quit() error

type Plugin

type Plugin interface {
	Init(path string) error                                         // init plugin
	Has(funcName string) bool                                       // check if plugin has function
	Call(funcName string, args ...interface{}) (interface{}, error) // call function
	Quit() error                                                    // quit plugin
}

func Init

func Init(path string) (Plugin, error)

Jump to

Keyboard shortcuts

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