shared

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 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 *proto.GetRequest) (*proto.GetResponse, error)

func (*GRPCClient) RefreshConnections

func (*GRPCClient) Shutdown

type GRPCServer

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

GRPCServer is the gRPC server that GRPCClient talks to.

func (*GRPCServer) Get

func (*GRPCServer) Shutdown

type PluginManager

type PluginManager interface {
	Get(req *proto.GetRequest) (*proto.GetResponse, error)
	RefreshConnections(req *proto.RefreshConnectionsRequest) (*proto.RefreshConnectionsResponse, error)
	Shutdown(req *proto.ShutdownRequest) (*proto.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