shared

package
v0.5.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const PluginTypeEnvName = "HRP_PLUGIN_TYPE"

PluginTypeEnvName is used to specify hashicorp go plugin type, rpc/grpc

View Source
const Version = "v0.5.3"

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "HttpRunnerPlus",
	MagicCookieValue: "debugtalk",
}

HandshakeConfig is used to just do a basic handshake between a plugin and host. If the handshake fails, a user friendly error is shown. This prevents users from executing bad plugins or executing a plugin directory. It is a UX feature, not a security feature.

Functions

func CallFunc

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

CallFunc calls function with arguments

func ConvertCommonName

func ConvertCommonName(name string) string

ConvertCommonName returns name which deleted "_" and converted capital letter to their lower case

Types

type IFuncCaller

type IFuncCaller interface {
	GetNames() ([]string, error)                                    // get all plugin function names list
	Call(funcName string, args ...interface{}) (interface{}, error) // call plugin function
}

IFuncCaller is the interface that we're exposing as a plugin.

Jump to

Keyboard shortcuts

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