Documentation ¶
Index ¶
- Constants
- Variables
- func CallFunc(fn reflect.Value, args ...interface{}) (interface{}, error)
- func CloseLogFile() error
- func ConvertCommonName(name string) string
- func InitLogger(logLevel hclog.Level, logFile string, disableTime bool) hclog.Logger
- func Register(funcName string, fn interface{})
- func Serve()
- type GRPCPlugin
- type IFuncCaller
- type RPCPlugin
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.
View Source
var Logger = hclog.New(&hclog.LoggerOptions{ Name: "fungo", Output: hclog.DefaultOutput, DisableTime: true, Level: hclog.Debug, Color: hclog.AutoColor, })
Functions ¶
func CloseLogFile ¶
func CloseLogFile() error
func ConvertCommonName ¶
ConvertCommonName returns name which deleted "_" and converted capital letter to their lower case
func InitLogger ¶
Types ¶
type GRPCPlugin ¶
type GRPCPlugin struct { plugin.Plugin Impl IFuncCaller }
GRPCPlugin 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 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.
type RPCPlugin ¶
type RPCPlugin struct {
Impl IFuncCaller
}
RPCPlugin implements hashicorp's plugin.Plugin.
Click to show internal directories.
Click to hide internal directories.