metathings_plugin_evaluator

package
v1.2.16-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedOperatorName  = errors.New("unsupported operator name")
	ErrUnexpectedOperatorResult = errors.New("unexpected operator result")
)

Functions

func IsValidOperatorName

func IsValidOperatorName(driver string) bool

Types

type Evaluator

type Evaluator interface {
	Id() string
	Eval(context.Context, esdk.Data) (esdk.Data, error)
}

func NewEvaluator

func NewEvaluator(args ...interface{}) (Evaluator, error)

type EvaluatorImpl

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

func NewEvaluatorImpl

func NewEvaluatorImpl(args ...interface{}) (*EvaluatorImpl, error)

func (*EvaluatorImpl) Eval

func (e *EvaluatorImpl) Eval(ctx context.Context, dat esdk.Data) (esdk.Data, error)

func (*EvaluatorImpl) Id

func (e *EvaluatorImpl) Id() string

type EvaluatorImplOption

type EvaluatorImplOption struct {
	Operator map[string]interface{}
}

type LuaOperator

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

func (*LuaOperator) Close

func (lo *LuaOperator) Close() error

func (*LuaOperator) Run

func (lo *LuaOperator) Run(gctx context.Context, ctx, dat esdk.Data) (esdk.Data, error)

type LuaOperatorOption

type LuaOperatorOption struct {
	Code string
}

type Operator

type Operator interface {
	Run(gctx context.Context, ctx, dat esdk.Data) (esdk.Data, error)
	Close() error
}

func NewLuaOperator

func NewLuaOperator(args ...interface{}) (Operator, error)

func NewOperator

func NewOperator(driver string, args ...interface{}) (Operator, error)

type OperatorFactory

type OperatorFactory func(args ...interface{}) (Operator, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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