plugin

package
v0.0.0-...-0b43789 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvJRPlugin = "JR_PLUGIN"

	PythonPlugin       = "python"
	PythonPluginScript = "plugin.py"
)

Variables

This section is empty.

Functions

func GetPluginMap

func GetPluginMap() map[string]*Plugin

func ReadConfig

func ReadConfig(plugin string) ([]byte, error)

func RegisterLocalPlugin

func RegisterLocalPlugin(name string, plugin *Plugin)

func RegisterRemotePlugin

func RegisterRemotePlugin(name string, plugin *Plugin)

Types

type Adapter

type Adapter struct {
	Producer
	// contains filtered or unexported fields
}

func NewAdapter

func NewAdapter(jrpcProducer jrpc.Producer) *Adapter

func (*Adapter) Produce

func (a *Adapter) Produce(_ context.Context,
	key []byte,
	v []byte,
	headers map[string]string,
	configParams map[string]string) (*jrpc.ProduceResponse, error)

type Plugin

type Plugin struct {
	Name      string
	RPCClient plugin.ClientProtocol

	Producer Producer
	Command  string
	IsRemote bool
	// contains filtered or unexported fields
}

func GetPlugin

func GetPlugin(name string) *Plugin

func New

func New(jrPlugin string, logLevel hclog.Level) (*Plugin, error)

func (*Plugin) Close

func (c *Plugin) Close() error

func (*Plugin) Produce

func (c *Plugin) Produce(ctx context.Context, key []byte, value []byte, headers map[string]string, configParams map[string]string) (*jrpc.ProduceResponse, error)

type Producer

type Producer interface {
	Produce(ctx context.Context, key []byte, v []byte, headers map[string]string, configParams map[string]string) (*jrpc.ProduceResponse, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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