1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- package actor
- import (
- "sparrow/pkg/protocol"
- "sparrow/pkg/ruleEngine"
- )
- // RuleChainToRuleNodeMsg 规则链到规则节点的消息定义
- type RuleChainToRuleNodeMsg struct {
- Message *protocol.Message
- Ctx ruleEngine.Context
- FromRelationType string
- }
- func (r *RuleChainToRuleNodeMsg) GetMessageType() protocol.MsgType {
- return protocol.RULE_CHAIN_TO_RULE_MSG
- }
- // RuleChainToRuleChainMsg 规则链到另一个规则链的消息
- type RuleChainToRuleChainMsg struct {
- TargetId string
- SourceId string
- FromRelationType string
- Message *protocol.Message
- }
- func (t *RuleChainToRuleChainMsg) GetMessageType() protocol.MsgType {
- return protocol.RULE_CHAIN_TO_RULE_CHAIN_MSG
- }
- // TransportToDeviceActorMsg 传输层到设备actor的消息定义
- type TransportToDeviceActorMsg struct {
- Message *protocol.Message
- }
- func (t *TransportToDeviceActorMsg) GetMessageType() protocol.MsgType {
- return protocol.TRANSPORT_TO_DEVICE_ACTOR_MSG
- }
- // QueueToRuleEngineMsg 消息队列到规则引擎的消息定义
- type QueueToRuleEngineMsg struct {
- TenantId string
- Message *protocol.Message
- RelationTypes []string
- FailureMessage error
- }
- func (q *QueueToRuleEngineMsg) GetMessageType() protocol.MsgType {
- return protocol.QUEUE_TO_RULE_ENGINE_MSG
- }
- type RuleNodeToRuleChanTellNextMsg struct {
- RuleNodeId string
- RelationTypes []protocol.RelationType
- Message *protocol.Message
- FailureMessage error
- }
- func (r *RuleNodeToRuleChanTellNextMsg) GetMessageType() protocol.MsgType {
- return protocol.RULE_TO_RULE_CHAIN_TELL_NEXT_MSG
- }
- type RuleToSelfMsg struct {
- Message *protocol.Message
- }
- func (r *RuleToSelfMsg) GetMessageType() protocol.MsgType {
- return protocol.RULE_TO_SELF_MSG
- }
- // AppInitMsg app 初始化消息
- type AppInitMsg struct {
- }
- func (a *AppInitMsg) GetMessageType() protocol.MsgType {
- return protocol.APP_INIT_MSG
- }
|