rules

package
v0.0.0-...-89bbdfb Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0, BSD-3-Clause, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuleDefStruct

type RuleDefStruct struct {
	Name                               string `json:"name"`
	Description                        string `json:"description"`
	CondDevice                         string `json:"condDevice"`
	CondResource                       string `json:"condResource"`
	CondCompareNewMetricToValue        bool   `json:"condCompareNewMetricToValue"`
	CondCompareNewMetricToValueOp      string `json:"condCompareNewMetricToValueOp"`
	CondCompareNewMetricValue          string `json:"condCompareNewMetricValue"`
	CondCompareNewMetricToLastMetric   bool   `json:"condCompareNewMetricToLastMetric"`
	CondCompareNewMetricToLastMetricOp string `json:"condCompareNewMetricToLastMetricOp"`
	CondCompareLastMetricToValue       bool   `json:"condCompareLastMetricToValue"`
	CondCompareLastMetricToValueOp     string `json:"condCompareLastMetricToValueOp"`
	CondCompareLastMetricValue         string `json:"condCompareLastMetricValue"`
	ActionSendNotification             bool   `json:"actionSendNotification"`
	ActionNotification                 string `json:"actionNotification"`
	ActionSendCommand                  bool   `json:"actionSendCommand"`
	ActionDevice                       string `json:"actionDevice"`
	ActionResource                     string `json:"actionResource"`
	ActionValue                        string `json:"actionValue"`
}

RuleDefStruct - rule definition data

type RuleEngine

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

func (*RuleEngine) AddRule

func (this *RuleEngine) AddRule(ruleDef RuleDefStruct)

AddRule - add rule

func (*RuleEngine) Assert

func (this *RuleEngine) Assert(eventID string, gateway string, device string, name string, value string) error

func (*RuleEngine) CreateAndLoadRuleSessionThenStart

func (this *RuleEngine) CreateAndLoadRuleSessionThenStart(tupleDescriptor string, rulesDefs string) error

CreateAndLoadRuleSession - creates a rule session and loads rules from config file

func (*RuleEngine) CreateRuleSessionThenStart

func (this *RuleEngine) CreateRuleSessionThenStart(tupleDescriptor string) error

CreateRuleSession - creates a rule session

func (*RuleEngine) DeleteRule

func (this *RuleEngine) DeleteRule(ruleName string)

DeleteRule - remove rule

func (*RuleEngine) GetOrCreateResourceTuple

func (this *RuleEngine) GetOrCreateResourceTuple(gateway, device, resource, value string) model.MutableTuple

GetOrCreateResourceTuple - Gets or Creates an assertedtuple (resources are stateful concepts)

func (*RuleEngine) RegisterConditionsAndActions

func (this *RuleEngine) RegisterConditionsAndActions()

RegisterConditionsAndActions - register rule conditions and actions

func (*RuleEngine) SetEngineID

func (this *RuleEngine) SetEngineID(engineID string)

Set Engine

func (*RuleEngine) SetSender

func (this *RuleEngine) SetSender(sender sender.Sender)

Set Sender

Jump to

Keyboard shortcuts

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