schema.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package protocol
  2. import "fmt"
  3. // RelationType 默认节点关系
  4. type RelationType string
  5. const (
  6. Success RelationType = "Success" // 成功
  7. Failure RelationType = "Failure" // 失败
  8. Other RelationType = "Other" // 其他
  9. True RelationType = "True" // 真
  10. False RelationType = "False" // 假
  11. PostAttributes RelationType = "Post attributes" // 上报属性
  12. PostEvent RelationType = "Post Event" // 上报事件
  13. ConnectEvent RelationType = "Connect Event" // 接入
  14. DisconnectEvent RelationType = "Disconnect Event" // 断开
  15. )
  16. const (
  17. POST_ATTRIBUTES_REQUEST = "POST_ATTRIBUTES_REQUEST" // 属性上报消息
  18. POST_EVENT_REQUEST = "POST_EVENT_REQUEST" // 事件上报消息
  19. CONNECT_EVENT = "CONNECT_EVENT" // 接入事件
  20. DISCONNECT_EVENT = "DISCONNECT_EVENT" // 断开事件
  21. )
  22. // RuleNodeInfo rule node info for output
  23. type RuleNodeInfo struct {
  24. ruleNodeId string
  25. ruleChainName string
  26. ruleNodeName string
  27. }
  28. func (r *RuleNodeInfo) String() string {
  29. return fmt.Sprintf("[RuleChain:%s|RuleNode:%s|RuleNodeId:%s]", r.ruleChainName, r.ruleNodeName, r.ruleNodeId)
  30. }
  31. type RuleNodeRelation struct {
  32. In string
  33. Out string
  34. RelationType RelationType
  35. }