plugins

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: AGPL-3.0 Imports: 15 Imported by: 1

Documentation

Overview

filepath: /Users/Justin.Neubert/projects/v1flows/v1Flows/runner/pkg/plugins/download.go

filepath: /Users/Justin.Neubert/projects/v1flows/v1Flows/runner/pkg/plugins/init.go

filepath: /Users/Justin.Neubert/projects/v1flows/v1Flows/runner/pkg/plugins/plugin.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupUnusedPlugins

func CleanupUnusedPlugins(pluginRepos []config.PluginConfig, pluginDir string) error

func DownloadPlugins added in v1.0.4

func DownloadPlugins(pluginRepos []config.PluginConfig, buildDir string, pluginDir string) (map[string]string, error)

DownloadAndBuildPlugins downloads and builds plugins from GitHub

func Init

func Init(cfg *config.Config) (loadedPlugin map[string]Plugin, plugins []shared_models.Plugin, actionPlugins []shared_models.Plugin, endpointPlugins []shared_models.Plugin)

func ShutdownPlugins

func ShutdownPlugins()

ShutdownPlugins terminates all plugin clients

Types

type CancelTaskRequest added in v1.1.0

type CancelTaskRequest struct {
	Step shared_models.ExecutionSteps
}

type EndpointRequest

type EndpointRequest struct {
	Config   *config.Config
	Body     []byte
	Platform string
}

type ExecuteTaskRequest

type ExecuteTaskRequest struct {
	Args      map[string]string
	Config    *config.Config
	Flow      shared_models.Flows
	FlowBytes []byte
	Execution shared_models.Executions
	Step      shared_models.ExecutionSteps
	Alert     af_models.Alerts
	Platform  string
	Workspace string
}

type InfoRequest added in v1.0.1

type InfoRequest struct {
	Config    *config.Config
	Workspace string
}

type Plugin

type Plugin interface {
	ExecuteTask(request ExecuteTaskRequest) (Response, error)
	CancelTask(req CancelTaskRequest) (Response, error)
	EndpointRequest(request EndpointRequest) (Response, error)
	Info(request InfoRequest) (shared_models.Plugin, error)
}

Plugin interface that all plugins must implement

type PluginRPC

type PluginRPC struct {
	Client *rpc.Client
}

PluginRPC is an implementation of net/rpc for Plugin

func (*PluginRPC) CancelTask added in v1.1.0

func (p *PluginRPC) CancelTask(request CancelTaskRequest) (Response, error)

func (*PluginRPC) EndpointRequest

func (p *PluginRPC) EndpointRequest(request EndpointRequest) (Response, error)

func (*PluginRPC) ExecuteTask

func (p *PluginRPC) ExecuteTask(request ExecuteTaskRequest) (Response, error)

func (*PluginRPC) Info

func (p *PluginRPC) Info(request InfoRequest) (shared_models.Plugin, error)

type PluginRPCServer

type PluginRPCServer struct {
	Impl Plugin
}

PluginRPCServer is the RPC server for Plugin

func (*PluginRPCServer) CancelTask added in v1.1.0

func (s *PluginRPCServer) CancelTask(request CancelTaskRequest, resp *Response) error

func (*PluginRPCServer) EndpointRequest

func (s *PluginRPCServer) EndpointRequest(request EndpointRequest, resp *Response) error

func (*PluginRPCServer) ExecuteTask

func (s *PluginRPCServer) ExecuteTask(request ExecuteTaskRequest, resp *Response) error

func (*PluginRPCServer) Info

func (s *PluginRPCServer) Info(request InfoRequest, resp *shared_models.Plugin) error

type PluginServer

type PluginServer struct {
	Impl Plugin
}

PluginServer is the implementation of plugin.Plugin interface

func (*PluginServer) Client

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

func (*PluginServer) Server

func (p *PluginServer) Server(*plugin.MuxBroker) (interface{}, error)

type Response

type Response struct {
	Data      map[string]interface{}
	Flow      *shared_models.Flows
	FlowBytes []byte
	Alert     *af_models.Alerts
	Success   bool
	Canceled  bool
}

Jump to

Keyboard shortcuts

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