Documentation ¶
Index ¶
Constants ¶
View Source
const GRPCPluginName = PluginName + "_grpc"
View Source
const PluginName = "debugtalk"
View Source
const RPCPluginName = PluginName + "_rpc"
Variables ¶
View Source
var HandshakeConfig = plugin.HandshakeConfig{ ProtocolVersion: 1, MagicCookieKey: "HttpRunnerPlus", MagicCookieValue: PluginName, }
handshakeConfigs are 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 IsRPCPluginType ¶
func IsRPCPluginType() bool
Types ¶
type FuncCaller ¶
type FuncCaller interface { GetNames() ([]string, error) // get all plugin function names list Call(funcName string, args ...interface{}) (interface{}, error) // call plugin function }
FuncCaller is the interface that we're exposing as a plugin.
type GRPCPlugin ¶
type GRPCPlugin struct { plugin.Plugin Impl FuncCaller }
HRPPlugin implements hashicorp's plugin.GRPCPlugin.
func (*GRPCPlugin) GRPCClient ¶
func (p *GRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*GRPCPlugin) GRPCServer ¶
func (p *GRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type HashicorpPlugin ¶
type HashicorpPlugin struct { 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 IPlugin ¶
type RPCPlugin ¶
type RPCPlugin struct {
Impl FuncCaller
}
RPCPlugin implements hashicorp's plugin.Plugin.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.