action

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddName     = "add"
	AddUsageMsg = "usage: add(key, value)"
)
View Source
const (
	CopyName     = "copy"
	CopyUsageMsg = "usage: copy(from, to)"
)
View Source
const (
	DelName     = "del"
	DelUsageMsg = "usage: del(key1, key2...)"
)
View Source
const (
	DropEventName     = "dropEvent"
	DropEventUsageMsg = "usage: dropEvent()"
)
View Source
const (
	FmtName     = "fmt"
	FmtUsageMsg = "usage: fmt(key)"
)
View Source
const (
	FmtKeyName     = "fmtKey"
	FmtKeyUsageMsg = "usage: fmtKey()"
)
View Source
const (
	JsonDecodeName     = "jsonDecode"
	JsonDecodeUsageMsg = "usage: jsonDecode(key) or jsonDecode(key, to)"
)
View Source
const (
	MoveName     = "move"
	MoveUsageMsg = "usage: move(from, to)"
)
View Source
const (
	PrintName     = "print"
	PrintUsageMsg = "usage: print()"
)
View Source
const (
	RegexName     = "regex"
	RegexUsageMsg = "usage: regex(key) or regex(key, to)"
)
View Source
const (
	ReturnName     = "return"
	ReturnUsageMsg = "usage: return()"
)
View Source
const (
	SetName     = "set"
	SetUsageMsg = "usage: set(key, value)"
)
View Source
const (
	StrConvertName     = "strconv"
	StrConvertUsageMsg = "usage: strconv(key, type)"
)
View Source
const (
	TimestampName     = "timestamp"
	TimestampUsageMsg = "usage: timestamp(key)"

	LayoutUnix   = "unix"
	LayoutUnixMs = "unix_ms"
)
View Source
const (
	UnderRootName     = "underRoot"
	UnderRootUsageMsg = "usage: underRoot(key)"
)
View Source
const (
	HeaderRoot = "_root"
)

Variables

View Source
var ErrorDropEvent = errors.New("DROP_EVENT")
View Source
var ErrorReturn = errors.New("RETURN")

Functions

func RegisterAction

func RegisterAction(name string, f Factory)

Types

type Action

type Action interface {
	// contains filtered or unexported methods
}

type Add

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

func NewAdd

func NewAdd(args []string) (*Add, error)

type Config

type Config cfg.CommonCfg

func (*Config) ToActionCfg

func (c *Config) ToActionCfg() (*ConfigAction, error)

func (*Config) Validate

func (c *Config) Validate() error

type ConfigAction

type ConfigAction struct {
	Expression  string        `yaml:"action,omitempty"`
	IgnoreError bool          `yaml:"ignoreError,omitempty"`
	Extra       cfg.CommonCfg `yaml:",inline,omitempty"`
}

type Copy

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

func NewCopy

func NewCopy(args []string) (*Copy, error)

type Del

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

func NewDel

func NewDel(args []string) (*Del, error)

type DropEvent

type DropEvent struct {
}

func NewDropEvent

func NewDropEvent(args []string) (*DropEvent, error)

type Factory

type Factory func(args []string, extra cfg.CommonCfg) (Action, error)

type Fmt

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

func NewFmt

func NewFmt(args []string, extra cfg.CommonCfg) (*Fmt, error)

type FmtKey

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

func NewFmtKey

func NewFmtKey(args []string, extra cfg.CommonCfg) (*FmtKey, error)

type FmtKeyExtra

type FmtKeyExtra struct {
	Regex   string `yaml:"regex,omitempty" validate:"required"`
	Replace string `yaml:"replace,omitempty" validate:"required"`
}

type Instance

type Instance struct {
	Name string
	Action
	Config ConfigAction
}

func GetAction

func GetAction(c Config) (*Instance, error)

GetAction ..

func (*Instance) Exec

func (a *Instance) Exec(e api.Event) error

type JsonDecode

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

func NewJsonDecode

func NewJsonDecode(args []string) (*JsonDecode, error)

type Move

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

func NewMove

func NewMove(args []string) (*Move, error)

type Print

type Print struct {
}

func NewPrint

func NewPrint(args []string) (*Print, error)

type Regex

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

func NewRegex

func NewRegex(args []string, extra cfg.CommonCfg) (*Regex, error)

type Return

type Return struct {
}

func NewReturn

func NewReturn(args []string) (*Return, error)

type Set

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

Set is same with Add

func NewSet

func NewSet(args []string) (*Set, error)

type StrConvert

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

func NewStrConvert

func NewStrConvert(args []string) (*StrConvert, error)

type Timestamp

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

func NewTimestamp

func NewTimestamp(args []string, extra cfg.CommonCfg) (*Timestamp, error)

type UnderRoot

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

func NewUnderRoot

func NewUnderRoot(args []string) (*UnderRoot, error)

Jump to

Keyboard shortcuts

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