plugins

package
v0.0.0-...-7b16d43 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DELETED = "$deleted"

Variables

View Source
var (
	PluginTypes = []string{"sources", "sinks", "functions"}
)

Functions

func AddSourceConfKey

func AddSourceConfKey(pluginName, confKey, language string, content []byte) error

func AddSourceConfKeyField

func AddSourceConfKeyField(pluginName, confKey, language string, content []byte) error

func DelSourceConfKey

func DelSourceConfKey(pluginName, confKey, language string) error

func DelSourceConfKeyField

func DelSourceConfKeyField(pluginName, confKey, language string, content []byte) error

func GetFunction

func GetFunction(t string) (api.Function, error)

func GetFunctions

func GetFunctions() (ret []*uiFuncs)

func GetSink

func GetSink(t string) (api.Sink, error)

func GetSinkMeta

func GetSinkMeta(pluginName, language string, rule *api.Rule) (ptrSinkProperty *uiSinks, err error)

func GetSinks

func GetSinks() (sinks []*pluginfo)

func GetSource

func GetSource(t string) (api.Source, error)

func GetSourceConf

func GetSourceConf(pluginName, language string) (b []byte, err error)

func GetSourceConfKeys

func GetSourceConfKeys(pluginName string) (keys []string)

func GetSourceMeta

func GetSourceMeta(pluginName, language string) (ptrSourceProperty *uiSource, err error)

func GetSources

func GetSources() (sources []*pluginfo)

Types

type Manager

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

func NewPluginManager

func NewPluginManager() (*Manager, error)

func (*Manager) Delete

func (m *Manager) Delete(t PluginType, name string, stop bool) error

func (*Manager) Get

func (m *Manager) Get(t PluginType, name string) (map[string]string, bool)

func (*Manager) List

func (m *Manager) List(t PluginType) (result []string, err error)

func (*Manager) Register

func (m *Manager) Register(t PluginType, j *Plugin) error

type Plugin

type Plugin struct {
	Name       string   `json:"name"`
	File       string   `json:"file"`
	ShellParas []string `json:"shellParas"`
}

type PluginType

type PluginType int
const (
	SOURCE PluginType = iota
	SINK
	FUNCTION
)

type Registry

type Registry struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Registry is append only because plugin cannot delete or reload. To delete a plugin, restart the server to reindex

func (*Registry) Get

func (rr *Registry) Get(t PluginType, name string) (string, bool)

func (*Registry) List

func (rr *Registry) List(t PluginType) []string

func (*Registry) Store

func (rr *Registry) Store(t PluginType, name string, version string)

Directories

Path Synopsis
functions
countPlusOne command
echo command
resize command
thumbnail command
sinks
file command
image command
memory command
zmq command
sources
random command
zmq command

Jump to

Keyboard shortcuts

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