Documentation ¶
Index ¶
- type RuleDefStruct
- type RuleEngine
- func (this *RuleEngine) AddRule(ruleDef RuleDefStruct)
- func (this *RuleEngine) Assert(eventID string, gateway string, device string, name string, value string) error
- func (this *RuleEngine) CreateAndLoadRuleSessionThenStart(tupleDescriptor string, rulesDefs string) error
- func (this *RuleEngine) CreateRuleSessionThenStart(tupleDescriptor string) error
- func (this *RuleEngine) DeleteRule(ruleName string)
- func (this *RuleEngine) GetOrCreateResourceTuple(gateway, device, resource, value string) model.MutableTuple
- func (this *RuleEngine) RegisterConditionsAndActions()
- func (this *RuleEngine) SetEngineID(engineID string)
- func (this *RuleEngine) SetSender(sender sender.Sender)
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) 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
Click to show internal directories.
Click to hide internal directories.