plugins

package
v0.0.0-...-fa1d311 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort

func GetFreePort() (port int, err error)

func NewEventPlugins

func NewEventPlugins(plugins []*Plugin) itf.EventPlugins

Types

type AppServiceServer

type AppServiceServer struct {
	proto.UnimplementedAppServiceServer
}

implement structure for grpc server for AppService

func (*AppServiceServer) Input

func (s *AppServiceServer) Input(ctx context.Context, in *proto.InputReq) (res *proto.InputRes, err error)

Input

func (*AppServiceServer) Result

func (s *AppServiceServer) Result(ctx context.Context, in *proto.ResultReq) (res *proto.ResultRes, err error)

Result

type EventPlugin

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

func (*EventPlugin) Command

func (p *EventPlugin) Command(name string, data any) (res itf.PluginCommandResult, err error)

func (*EventPlugin) Input

func (p *EventPlugin) Input(buffer int, config map[string]string) (res <-chan itf.PluginInput, err error)

func (*EventPlugin) Output

func (p *EventPlugin) Output(uuid string, topic string, data []byte, metadata map[string][]string) (err error)

type EventPlugins

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

func (*EventPlugins) GetPlugin

func (p *EventPlugins) GetPlugin(id string) (res itf.EventPlugin, err error)

type Plugin

type Plugin struct {
	AppPort int
	ID      string
	Host    string
	Port    int
	Exec    string
	Name    string
	Args    []string
	Env     []string
	Config  config.Plugin
	Output  bool

	ConnRetry int
	ConnDelay time.Duration
	// contains filtered or unexported fields
}

func (*Plugin) Start

func (p *Plugin) Start() (err error)

func (*Plugin) Stop

func (p *Plugin) Stop()

type PluginCommandResult

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

func (*PluginCommandResult) GetCommand

func (r *PluginCommandResult) GetCommand() string

func (*PluginCommandResult) GetData

func (r *PluginCommandResult) GetData() (any, error)

func (*PluginCommandResult) GetUUID

func (r *PluginCommandResult) GetUUID() string

func (*PluginCommandResult) IsAsync

func (r *PluginCommandResult) IsAsync() bool

type PluginInput

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

func (*PluginInput) GetInput

func (p *PluginInput) GetInput() *proto.InputRes

func (*PluginInput) GetTime

func (p *PluginInput) GetTime() time.Time

type PluginManager

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

func NewPluginManager

func NewPluginManager() (res *PluginManager, err error)

func (*PluginManager) CreatePlugin

func (p *PluginManager) CreatePlugin(cfg config.Plugin) (res *Plugin, err error)

func (*PluginManager) GetPlugin

func (p *PluginManager) GetPlugin(id string) (res *Plugin, err error)

func (*PluginManager) Start

func (p *PluginManager) Start() (err error)

func (*PluginManager) Stop

func (p *PluginManager) Stop() (err error)

Jump to

Keyboard shortcuts

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