plugin_manager

package
v0.11.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindPluginFolder

func FindPluginFolder(remoteSchema string) (string, error)

FindPluginFolder searches for a folder which when hashed would match the schema

func GetPluginManager

func GetPluginManager() (pluginshared.PluginManager, error)

GetPluginManager connects to a running plugin manager

func GetPluginPath

func GetPluginPath(plugin, pluginShortName string) (string, error)

func PluginFQNToSchemaName

func PluginFQNToSchemaName(pluginFQN string) string

PluginFQNToSchemaName convert a full plugin name to a schema name schemas in postgres are limited to 63 chars - the name may be longer than this, in which case trim the length and add a hash to the end to make unique

func StartNewInstance

func StartNewInstance(steampipeExecutablePath string) error

StartNewInstance loads the plugin manager state, stops any previous instance and instantiates a new plugin manager

func Stop

func Stop() error

Stop loads the plugin manager state and if a running instance is found, stop it

Types

type PluginManager

type PluginManager struct {
	pb.UnimplementedPluginManagerServer

	Plugins map[string]*runningPlugin
	// contains filtered or unexported fields
}

PluginManager is the real implementation of grpc.PluginManager

func NewPluginManager

func NewPluginManager(connectionConfig map[string]*pb.ConnectionConfig, logger hclog.Logger) *PluginManager

func (*PluginManager) Get

func (m *PluginManager) Get(req *pb.GetRequest) (*pb.GetResponse, error)

func (*PluginManager) Serve

func (m *PluginManager) Serve()

func (*PluginManager) SetConnectionConfigMap

func (m *PluginManager) SetConnectionConfigMap(configMap map[string]*pb.ConnectionConfig)

func (*PluginManager) Shutdown

func (m *PluginManager) Shutdown(req *pb.ShutdownRequest) (resp *pb.ShutdownResponse, err error)

type PluginManagerClient

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

PluginManagerClient is the client used by steampipe to access the plugin manager

func NewPluginManagerClient

func NewPluginManagerClient(pluginManagerState *PluginManagerState) (*PluginManagerClient, error)

func (*PluginManagerClient) Get

func (c *PluginManagerClient) Get(req *pb.GetRequest) (res *pb.GetResponse, err error)

func (*PluginManagerClient) Shutdown

func (c *PluginManagerClient) Shutdown(req *pb.ShutdownRequest) (res *pb.ShutdownResponse, err error)

type PluginManagerState

type PluginManagerState struct {
	Protocol        plugin.Protocol
	ProtocolVersion int
	Addr            *pb.SimpleAddr
	Pid             int
	// path to the steampipe executable
	Executable string
	// is the plugin manager running
	Running bool `json:"-"`
}

func LoadPluginManagerState

func LoadPluginManagerState() (*PluginManagerState, error)

func NewPluginManagerState

func NewPluginManagerState(executable string, reattach *plugin.ReattachConfig) *PluginManagerState

func (*PluginManagerState) Save

func (s *PluginManagerState) Save() error

Directories

Path Synopsis
grpc
shared
Package shared contains shared data between the host and plugins.
Package shared contains shared data between the host and plugins.

Jump to

Keyboard shortcuts

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