plugin

package
v4.0.0-...-88824ee Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: BSD-2-Clause, BSD-2-Clause Imports: 146 Imported by: 0

README

# the packages.go file is generated by the scriggo command, DO NOT alter it.

# to regenerate the packages file run the following:
rm -f packages.go
scriggo import -f packages.Scriggofile -o packages.go

Documentation

Index

Constants

View Source
const (
	BuiltinPackageName string = `gravwell`
	ConfigMapName      string = `ConfigMap`
	TaggerName         string = `Tagger`
	ExecuteFuncName    string = `Execute`
	ConfigFuncName     string = `Config`
	FlushFuncName      string = `Flush`
	ProcessFuncName    string = `Process`
	StartFuncName      string = `Start`
	CloseFuncName      string = `Close`
)

Variables

View Source
var (
	ErrInvalidScript = errors.New("invalid plugin program")
	ErrNotReady      = errors.New("not ready")
)

Functions

This section is empty.

Types

type CloseFunc

type CloseFunc func() error

type ConfigFunc

type ConfigFunc func(ConfigMap, Tagger) error

type ConfigMap

type ConfigMap interface {
	Names() []string
	GetBool(string) (bool, error)
	GetInt(string) (int64, error)
	GetUint(string) (uint64, error)
	GetFloat(string) (float64, error)
	GetString(string) (string, error)
	GetStringSlice(string) ([]string, error)
}

type FlushFunc

type FlushFunc func() []*entry.Entry

type PluginProgram

type PluginProgram struct {
	sync.WaitGroup
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(fsys fs.FS, debug bool) (pp *PluginProgram, err error)

func NewPluginProgram

func NewPluginProgram(content []byte, debug bool) (pp *PluginProgram, err error)

func (*PluginProgram) Close

func (pp *PluginProgram) Close() (err error)

func (*PluginProgram) Config

func (pp *PluginProgram) Config(vc *config.VariableConfig, tg Tagger) error

func (*PluginProgram) Flush

func (pp *PluginProgram) Flush() []*entry.Entry

func (*PluginProgram) Process

func (pp *PluginProgram) Process(ents []*entry.Entry) ([]*entry.Entry, error)

func (*PluginProgram) Ready

func (pp *PluginProgram) Ready() (r bool)

Ready indicates if the program is running and has registered all the things we need

func (*PluginProgram) Run

func (pp *PluginProgram) Run(to time.Duration) (err error)

Run will execute the underlying program and blocks for timeout time, it is waiting for the program to come up and register itself if it does not, then we kill it

func (*PluginProgram) Start

func (pp *PluginProgram) Start() (err error)

type ProcessFunc

type ProcessFunc func([]*entry.Entry) ([]*entry.Entry, error)

type StartFunc

type StartFunc func() error

type Tagger

type Tagger interface {
	NegotiateTag(name string) (entry.EntryTag, error)
	LookupTag(entry.EntryTag) (string, bool)
	KnownTags() []string
}

this is a copy of the interface in processors, but we can't import processors due to import cycles

type TestTagger

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

func NewTestTagger

func NewTestTagger() *TestTagger

func (*TestTagger) KnownTags

func (tt *TestTagger) KnownTags() (r []string)

func (*TestTagger) LookupTag

func (tt *TestTagger) LookupTag(tag entry.EntryTag) (r string, ok bool)

func (*TestTagger) NegotiateTag

func (tt *TestTagger) NegotiateTag(name string) (tag entry.EntryTag, err error)

Jump to

Keyboard shortcuts

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