actions

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Actions = map[string]Initializer{}

Functions

func DecodeConfig

func DecodeConfig(src, dst interface{}) error

func Register

func Register(name string, initFn Initializer)

Types

type Action

type Action interface {
	Init(map[string]interface{}, ...Option) error
	Run(*formatters.EventMsg, map[string]interface{}, map[string]interface{}) (interface{}, error)
	NName() string

	WithTargets(map[string]interface{})
	WithLogger(*log.Logger)
}

type Initializer

type Initializer func() Action

type Input added in v0.17.0

type Input struct {
	Event *formatters.EventMsg
	Env   map[string]interface{}
	Vars  map[string]interface{}
}

type Option

type Option func(Action)

func WithLogger

func WithLogger(l *log.Logger) Option

func WithTargets

func WithTargets(tcs map[string]interface{}) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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