This commit is contained in:
PandaGoAdmin
2023-03-28 17:23:11 +08:00
parent 6682c8d9fe
commit b9f0bd744c
46 changed files with 546 additions and 502 deletions

View File

@@ -0,0 +1,28 @@
package nodes
import (
"dz-iot-server/rule_engine/message"
"github.com/sirupsen/logrus"
)
type externalMqNode struct {
bareNode
}
type externalMqNodeFactory struct{}
func (f externalMqNodeFactory) Name() string { return "ExternalMqNode" }
func (f externalMqNodeFactory) Category() string { return NODE_CATEGORY_EXTERNAL }
func (f externalMqNodeFactory) Labels() []string { return []string{"Success", "Failure"} }
func (f externalMqNodeFactory) Create(id string, meta Metadata) (Node, error) {
node := &externalMqNode{
bareNode: newBareNode(f.Name(), id, meta, f.Labels()),
}
return decodePath(meta, node)
}
func (n *externalMqNode) Handle(msg message.Message) error {
logrus.Infof("%s handle message '%s'", n.Name(), msg.GetType())
return nil
}