node.go 549 B

1234567891011121314151617181920212223242526
  1. package ruleEngine
  2. import (
  3. "sparrow/pkg/entities"
  4. "sparrow/pkg/protocol"
  5. )
  6. type Node interface {
  7. Init(ctx Context, config string) error
  8. OnMessage(ctx Context, message *protocol.Message) error
  9. }
  10. // RuleNodeCtx 节点上下文
  11. type RuleNodeCtx struct {
  12. TenantId string // 租户Id
  13. ChainActor Ref // 规则链 actor
  14. SelfActor Ref // 当前节点的 actor
  15. Self *RuleNode // 当前节点
  16. }
  17. // RuleNodeRelation 节点关系
  18. type RuleNodeRelation struct {
  19. In entities.EntityId
  20. Out entities.EntityId
  21. Type string
  22. }