reportingplugins

package
v0.0.0-...-47b5856 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const PluginServiceName = "plugin-service"

PluginServiceName is the name for types.PluginClient/[NewGRPCService].

Variables

This section is empty.

Functions

func ReportingPluginHandshakeConfig

func ReportingPluginHandshakeConfig() plugin.HandshakeConfig

Types

type GRPCService

type GRPCService[T types.PluginProvider] struct {
	plugin.NetRPCUnsupportedPlugin

	loop.BrokerConfig

	PluginServer ProviderServer[T]
	// contains filtered or unexported fields
}

GRPCService is the loopp interface for a plugin that can run an arbitrary product in the core node. By specifying `T`, server instances can request a specific provider type.

func (*GRPCService[T]) ClientConfig

func (g *GRPCService[T]) ClientConfig() *plugin.ClientConfig

func (*GRPCService[T]) GRPCClient

func (g *GRPCService[T]) GRPCClient(_ context.Context, broker *plugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error)

GRPCClient implements plugin.GRPCPlugin and returns the pluginClient types.PluginClient, updated with the new broker and conn.

func (*GRPCService[T]) GRPCServer

func (g *GRPCService[T]) GRPCServer(broker *plugin.GRPCBroker, server *grpc.Server) error

type LOOPPService

LOOPPService is a types.Service that maintains an internal types.PluginClient.

func NewLOOPPService

func NewLOOPPService(
	lggr logger.Logger,
	grpcOpts loop.GRPCOpts,
	cmd func() *exec.Cmd,
	config types.ReportingPluginServiceConfig,
	providerConn grpc.ClientConnInterface,
	pipelineRunner types.PipelineRunnerService,
	telemetryService types.TelemetryService,
	errorLog types.ErrorLog,
) *LOOPPService

NewLOOPPService returns a new [*PluginService]. cmd must return a new exec.Cmd each time it is called. We use a `conn` here rather than a provider so that we can enforce proxy providers being passed in.

type MedianProviderServer

type MedianProviderServer = internal.MedianProviderServer

type PluginProviderServer

type PluginProviderServer = internal.PluginProviderServer

These implement `ConnToProvider` and return the conn wrapped as the specified provider type. They can be embedded into the server struct for ease of use.

type ProviderServer

type ProviderServer[T types.PluginProvider] interface {
	types.ReportingPluginServer[T]
	ConnToProvider(conn grpc.ClientConnInterface, broker internal.Broker, brokerConfig loop.BrokerConfig) T
}

Jump to

Keyboard shortcuts

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