shared

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package shared contains shared data between the host and plugins.

Index

Constants

View Source
const PluginName = "steampipe_plugin_manager"

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	MagicCookieKey:   "PLUGIN_MANAGER_MAGIC_COOKIE",
	MagicCookieValue: "really-complex-permanent-string-value",
}

Handshake is a common handshake that is shared by plugin and host.

View Source
var PluginMap = map[string]plugin.Plugin{
	PluginName: &PluginManagerPlugin{},
}

PluginMap is a ma of the plugins supported, _without the implementation_ this used to create a GRPC client

Functions

This section is empty.

Types

type GRPCClient

type GRPCClient struct {
	// contains filtered or unexported fields
}

GRPCClient is an implementation of PluginManager service that talks over GRPC.

func (*GRPCClient) Get

func (c *GRPCClient) Get(req *pb.GetRequest) (*pb.GetResponse, error)

func (*GRPCClient) Shutdown

func (c *GRPCClient) Shutdown(req *pb.ShutdownRequest) (*pb.ShutdownResponse, error)

type GRPCServer

type GRPCServer struct {
	pb.UnimplementedPluginManagerServer
	// This is the real implementation
	Impl PluginManager
}

GRPCServer is the gRPC server that GRPCClient talks to.

func (*GRPCServer) Get

func (m *GRPCServer) Get(_ context.Context, req *pb.GetRequest) (*pb.GetResponse, error)

func (*GRPCServer) Shutdown

type PluginManager

type PluginManager interface {
	Get(req *pb.GetRequest) (*pb.GetResponse, error)
	Shutdown(req *pb.ShutdownRequest) (*pb.ShutdownResponse, error)
}

PluginManager is the interface for the plugin manager service

type PluginManagerPlugin

type PluginManagerPlugin struct {
	// GRPCPlugin must still implement the Stub interface
	plugin.Plugin
	// Concrete implementation
	Impl PluginManager
}

PluginManagerPlugin is the implementation of plugin.GRPCServer so we can serve/consume this.

func (*PluginManagerPlugin) GRPCClient

func (p *PluginManagerPlugin) GRPCClient(ctx context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient returns a GRPCClient, called by Dispense

func (*PluginManagerPlugin) GRPCServer

func (p *PluginManagerPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error

Jump to

Keyboard shortcuts

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