executor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	RuleExecutor
	API      api.Interface
	Pipeline pipeline.Interface
	DingTalk dingtalkworknotice.Interface
}

func (*Executor) Do

func (e *Executor) Do(content map[string]interface{}, config *RuleConfig) string

func (*Executor) Fire

func (e *Executor) Fire(req *pb.FireRequest) ([]bool, error)

type ExprExecutor

type ExprExecutor struct {
	DB *db.DBClient
}

func (*ExprExecutor) AddExecutionRecords

func (e *ExprExecutor) AddExecutionRecords(r *RecordConfig) error

func (*ExprExecutor) BuildRuleEnv

func (e *ExprExecutor) BuildRuleEnv(req *rulepb.FireRequest) (*RuleEnv, error)

func (*ExprExecutor) Exec

func (e *ExprExecutor) Exec(r *RuleConfig, env map[string]interface{}) (bool, error)

type RecordConfig

type RecordConfig struct {
	Scope         string
	ScopeID       string
	Env           map[string]interface{}
	Results       []bool
	RuleConfigs   []*RuleConfig
	ActionOutputs []string
	Actors        []string
}

type RuleConfig

type RuleConfig struct {
	RuleID string
	Code   string
	Action db.ActionParams
	Actor  string
}

type RuleEnv

type RuleEnv struct {
	Configs []*RuleConfig
	Env     map[string]interface{}
}

type RuleExecutor

type RuleExecutor interface {
	Exec(r *RuleConfig, env map[string]interface{}) (bool, error)
	BuildRuleEnv(req *rulepb.FireRequest) (*RuleEnv, error)
	AddExecutionRecords(c *RecordConfig) error
}

Jump to

Keyboard shortcuts

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