application

package
v0.0.0-...-ce1d5a6 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StreamName         = "events"
	StreamSQLTemplate  = string(`{"sql":"create stream %s () WITH (FORMAT=\"JSON\", TYPE=\"edgex\")"}`)
	AddRuleSQLTemplate = string(`{"id":"%s","sql":"SELECT (collect(%s)[1] %s %s) as v FROM %s GROUP BY PADCOUNTWINDOW(2,1) FILTER(WHERE meta(deviceName) = \"%s\") HAVING collect(%s)[0]  %s %s OR collect(%s)[1] %s %s",
	"actions": [{
		"rest": {
			"url": "http://%s:%d/api/v2/rule/id/%s",
			"method": "post",
			"dataTemplate": "{\"triggerState\":{{.v}},\"triggerIndex\":%d}",
			"sendSingle": true
		  }
		}
	]}`)
	UpdateRuleSQLTemplate = string(`{"sql":"SELECT (collect(%s)[1] %s %s) as v FROM %s GROUP BY PADCOUNTWINDOW(2,1) FILTER(WHERE meta(deviceName) = \"%s\") HAVING collect(%s)[0]  %s %s OR collect(%s)[1] %s %s",
	"actions": [{
		"rest": {
			"url": "http://%s:%d/api/v2/rule/id/%s",
			"method": "post",
			"dataTemplate": "{\"triggerState\":{{.v}},\"triggerIndex\":%d}",
			"sendSingle": true
		  }
		}
	]}`)
)

Variables

This section is empty.

Functions

func AddRule

func AddRule(rule models.Rule) errors.EdgeX

func DeleteRuleByName

func DeleteRuleByName(name string) errors.EdgeX

func GetAllRule

func GetAllRule() []models.Rule

func GetRuleByName

func GetRuleByName(name string) (models.Rule, errors.EdgeX)

func InitRuleApplication

func InitRuleApplication(l logger.LoggingClient, portService int, hostService, urlCoreCommand, urlNotification, urlSchduler, urlRuleEngine string) error

func TriggerRuleById

func TriggerRuleById(id string, contentTrigger models.ContentTrigger)

func UpdateRuleByName

func UpdateRuleByName(name string, rule models.Rule) errors.EdgeX

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳