auth.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package databus
  2. import (
  3. "go-common/library/time"
  4. )
  5. // TableName case tablename
  6. func (*Group) TableName() string {
  7. return "auth2"
  8. }
  9. // Group group model
  10. type Group struct {
  11. ID int `gorm:"column:id" json:"id"`
  12. Group string `gorm:"column:group" json:"group"`
  13. AppID int `gorm:"column:app_id" json:"app_id"`
  14. AppKey string `gorm:"-" json:"app_key"`
  15. Project string `gorm:"-" json:"project"`
  16. TopicID int `gorm:"column:topic_id" json:"topic_id"`
  17. Topic string `gorm:"-" json:"topic"`
  18. Cluster string `gorm:"-" json:"cluster"`
  19. Operation int8 `gorm:"column:operation" json:"operation"`
  20. IsDelete int8 `gorm:"column:is_delete" json:"is_delete"`
  21. Remark string `gorm:"column:remark" json:"remark"`
  22. Alarm int8 `gorm:"column:alarm;default:1" json:"alarm"`
  23. Percentage string `gorm:"column:percentage" json:"percentage"`
  24. Number int `gorm:"column:number" json:"number"`
  25. Ctime time.Time `gorm:"column:ctime" json:"ctime"`
  26. Mtime time.Time `gorm:"column:mtime" json:"mtime"`
  27. Callback string `gorm:"-" json:"notify_callback"`
  28. Concurrent string `gorm:"-" json:"notify_concurrent"`
  29. Filter int8 `gorm:"-" json:"notify_filter"`
  30. Filters string `gorm:"-" json:"-"`
  31. FilterList []*Filter `gorm:"-" json:"filters"`
  32. State int8 `gorm:"-" json:"notify_state"`
  33. Gid int64 `gorm:"-" json:"notify_gid"`
  34. Nid int64 `gorm:"-" json:"notify_id"`
  35. Zone string `gorm:"-" json:"notify_zone"`
  36. }
  37. //Alarm alarm
  38. type Alarm struct {
  39. Group string `json:"group"`
  40. Project string `json:"project"`
  41. Alarm int8 `json:"alarm"`
  42. Percentage string `json:"percentage"`
  43. }
  44. //Alarms alarms
  45. type Alarms struct {
  46. Cluster string `json:"cluster"`
  47. Topic string `json:"topic"`
  48. Group string `json:"group"`
  49. Project string `json:"project"`
  50. Alarm int8 `json:"alarm"`
  51. Percentage string `json:"percentage"`
  52. Diff []*Record `json:"diff"`
  53. }
  54. // Record diff
  55. type Record struct {
  56. Partition int32 `json:"partition"`
  57. Diff int64 `json:"diff"`
  58. New int64 `json:"new"`
  59. }