shared

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 9 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.4.9"

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 added in v0.4.7

func ConvertCommonName(name string) string

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

func EnsurePython3Venv added in v0.4.1

func EnsurePython3Venv(venvDir string, packages ...string) (python3 string, err error)

EnsurePython3Venv ensures python3 venv for hashicorp python plugin venvDir should be directory path of target venv

func InstallPythonPackage added in v0.4.3

func InstallPythonPackage(python3 string, pkg string) (err error)

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