plugin

package
v0.0.0-...-f524348 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "NAUTLIUS",
	MagicCookieValue: "pipeline",
}
View Source
var PipelineProcessorCapabilityType_Name = map[int32]string{
	0: "None",
	1: "Metadata",
	2: "Storage",
}
View Source
var PipelineProcessorCapabilityType_Value = map[string]int32{
	"None":     0,
	"Metadata": 1,
	"Storage":  2,
}
View Source
var Plugins = map[string]plugin.Plugin{
	"pipeline": &PipelinePlugin{},
}

Functions

func RegisterPipelineProcessor

func RegisterPipelineProcessor(impl PipelineProcessor, address string) error

func ServePipelineProcessor

func ServePipelineProcessor(impl PipelineProcessor) error

Types

type PipelineContextData

type PipelineContextData struct {
	ID          string
	ContentType string
	Data        []byte
	Metadata    map[string]interface{}
}

type PipelinePlugin

type PipelinePlugin struct {
	Impl PipelineProcessor
}

func (*PipelinePlugin) Client

func (p *PipelinePlugin) Client(b *goplugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*PipelinePlugin) Server

func (p *PipelinePlugin) Server(*goplugin.MuxBroker) (interface{}, error)

type PipelineProcessor

type PipelineProcessor interface {
	Name() (string, error)

	GetCapabilities() (PipelineProcessorCapability, error)

	Configure(cfg map[string]interface{}) error

	Process(data *PipelineContextData) (*PipelineContextData, error)

	Health() error
}

type PipelineProcessorCapability

type PipelineProcessorCapability struct {
	Types []PipelineProcessorCapabilityType `json:"types"`
}

type PipelineProcessorCapabilityType

type PipelineProcessorCapabilityType int32

func (PipelineProcessorCapabilityType) String

type RpcClient

type RpcClient struct {
	Client *rpc.Client
}

func (*RpcClient) Configure

func (c *RpcClient) Configure(cfg map[string]interface{}) error

func (*RpcClient) GetCapabilities

func (c *RpcClient) GetCapabilities() (PipelineProcessorCapability, error)

func (*RpcClient) Health

func (c *RpcClient) Health() error

func (*RpcClient) Name

func (c *RpcClient) Name() (string, error)

func (*RpcClient) Process

type RpcServer

type RpcServer struct {
	Impl PipelineProcessor
}

func (*RpcServer) Configure

func (s *RpcServer) Configure(cfg map[string]interface{}, resp *error) error

func (*RpcServer) GetCapabilities

func (s *RpcServer) GetCapabilities(_ struct{}, resp *PipelineProcessorCapability) error

func (*RpcServer) Health

func (s *RpcServer) Health(_ struct{}, resp *error) error

func (*RpcServer) Name

func (s *RpcServer) Name(_ struct{}, resp *string) error

func (*RpcServer) Process

func (s *RpcServer) Process(args *PipelineContextData, resp *PipelineContextData) error

type ServeRegistrationErrorResponse

type ServeRegistrationErrorResponse struct {
	Error string `json:"error"`
}

type ServeRegistrationServer

type ServeRegistrationServer struct {
	Listener          net.Listener
	Server            *rpc.Server
	WaitGroup         sync.WaitGroup
	ActiveConnections sync.Map
	Cancel            context.CancelFunc
}

func NewRegistrationServer

func NewRegistrationServer(listener net.Listener) *ServeRegistrationServer

func (*ServeRegistrationServer) AcceptConnection

func (s *ServeRegistrationServer) AcceptConnection(ctx context.Context)

func (*ServeRegistrationServer) Start

func (*ServeRegistrationServer) WaitForShutdown

func (s *ServeRegistrationServer) WaitForShutdown() error

Jump to

Keyboard shortcuts

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