Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient represents gRPC client
func (*GRPCClient) ExecuteJob ¶
func (m *GRPCClient) ExecuteJob(job *proto.Job) (*proto.JobResult, error)
ExecuteJob triggers the execution of the given job in the plugin.
func (*GRPCClient) GetJobs ¶
func (m *GRPCClient) GetJobs() (proto.Plugin_GetJobsClient, error)
GetJobs requests all jobs from the plugin. We get a stream of proto.Job back.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin represents a single plugin instance which uses gRPC to connect to exactly one plugin.
func NewPlugin ¶
NewPlugin creates a new instance of Plugin. One Plugin instance represents one connection to a plugin.
It expects the start command to start the plugin and the log path (including file) where the output should be logged to.
func (*Plugin) Close ¶
func (p *Plugin) Close()
Close shutdown the plugin and kills the gRPC connection. Remember to call this when you call plugin.Connect.
func (*Plugin) Connect ¶
Connect starts the plugin, initiates the gRPC connection and looks up the plugin. It's up to the caller to call plugin.Close to shutdown the plugin and close the gRPC connection.
type PluginGRPC ¶
type PluginGRPC interface { GetJobs() (proto.Plugin_GetJobsClient, error) ExecuteJob(job *proto.Job) (*proto.JobResult, error) }
PluginGRPC is the Gaia plugin interface used for communication with the plugin.
type PluginGRPCImpl ¶
type PluginGRPCImpl struct { Impl PluginGRPC plugin.NetRPCUnsupportedPlugin }
PluginGRPCImpl represents the plugin implementation on client side.
func (*PluginGRPCImpl) GRPCClient ¶
func (p *PluginGRPCImpl) GRPCClient(context context.Context, b *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient is the passing method for the gRPC client.
func (*PluginGRPCImpl) GRPCServer ¶
func (p *PluginGRPCImpl) GRPCServer(b *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer is needed here to implement hashicorp plugin.Plugin interface. Real implementation is in the plugin(s).