entities.go 518 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package entities
  2. type EntityId interface {
  3. GetId() string
  4. GetEntityType() EntityType
  5. }
  6. type EntityType int
  7. const (
  8. TENANT EntityType = iota
  9. DEVICE
  10. ALARM
  11. RULE_CHAIN
  12. RULE_NODE
  13. )
  14. type RuleNodeId struct {
  15. id string
  16. }
  17. func (r *RuleNodeId) GetId() string {
  18. return r.id
  19. }
  20. func (r *RuleNodeId) GetEntityType() EntityType {
  21. return RULE_NODE
  22. }
  23. type RuleChainId struct {
  24. id string
  25. }
  26. func (r *RuleChainId) GetId() string {
  27. return r.id
  28. }
  29. func (r *RuleChainId) GetEntityType() EntityType {
  30. return RULE_CHAIN
  31. }