plugin

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package plugin contains core GRPC plugin functionality

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{

	MagicCookieKey:   "PHOBOS_PLUGIN",
	MagicCookieValue: "76ea237a1ea9728a9e294c76e503a38c4409707e477266c0b5525512ec81f174",
}

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

Functions

func Plugins

func Plugins(opts ...Option) map[int]plugin.PluginSet

Plugins returns the list of available plugins and initializes them with the given components. This will panic if an invalid component is given.

Types

type ActionExecutionResponse

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

ActionExecutionResponse is the response returned after executing an action

func (*ActionExecutionResponse) Outputs

func (c *ActionExecutionResponse) Outputs() map[string]cty.Value

Outputs returns the output data from the action

type MetadataPlugin

type MetadataPlugin struct {
	plugin.NetRPCUnsupportedPlugin
	Logger      hclog.Logger
	Description string
}

MetadataPlugin implements plugin.Plugin (specifically GRPCPlugin)

func (*MetadataPlugin) GRPCClient

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

GRPCClient returns the GRPC client

func (*MetadataPlugin) GRPCServer

func (p *MetadataPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer returns the GRPC server

type Option

type Option func(*pluginConfig)

Option configures Plugins

func WithComponents

func WithComponents(cs ...interface{}) Option

WithComponents sets the components to configure for the plugins. This will append to the components.

func WithLogger

func WithLogger(log hclog.Logger) Option

WithLogger sets the logger for the plugins.

func WithMappers

func WithMappers(ms ...*argmapper.Func) Option

WithMappers sets the mappers to configure for the plugins. This will append to the existing mappers.

func WithPluginDescription

func WithPluginDescription(description string) Option

WithPluginDescription sets the description for the plugin

type PipelinePlugin

type PipelinePlugin struct {
	plugin.NetRPCUnsupportedPlugin
	Impl    pipeline.Plugin
	Logger  hclog.Logger
	Mappers []*argmapper.Func
}

PipelinePlugin implements plugin.Plugin (specifically GRPCPlugin) for the pipeline component type.

func (*PipelinePlugin) GRPCClient

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

GRPCClient returns the GRPC client

func (*PipelinePlugin) GRPCServer

func (p *PipelinePlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer returns the GRPC server

Directories

Path Synopsis
Package terminal provides the GRPC terminal implementations
Package terminal provides the GRPC terminal implementations

Jump to

Keyboard shortcuts

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