models.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package search
  2. type HitType string
  3. const (
  4. DashHitDB HitType = "dash-db"
  5. DashHitHome HitType = "dash-home"
  6. DashHitJson HitType = "dash-json"
  7. DashHitScripted HitType = "dash-scripted"
  8. DashHitFolder HitType = "dash-folder"
  9. )
  10. type Hit struct {
  11. Id int64 `json:"id"`
  12. Title string `json:"title"`
  13. Uri string `json:"uri"`
  14. Type HitType `json:"type"`
  15. Tags []string `json:"tags"`
  16. IsStarred bool `json:"isStarred"`
  17. ParentId int64 `json:"parentId"`
  18. Dashboards []Hit `json:"dashboards"`
  19. }
  20. type HitList []*Hit
  21. func (s HitList) Len() int { return len(s) }
  22. func (s HitList) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
  23. func (s HitList) Less(i, j int) bool { return s[i].Title < s[j].Title }
  24. type Query struct {
  25. Title string
  26. Tags []string
  27. OrgId int64
  28. UserId int64
  29. Limit int
  30. IsStarred bool
  31. DashboardIds []int
  32. BrowseMode bool
  33. Result HitList
  34. }
  35. type FindPersistedDashboardsQuery struct {
  36. Title string
  37. OrgId int64
  38. UserId int64
  39. IsStarred bool
  40. DashboardIds []int
  41. BrowseMode bool
  42. Result HitList
  43. }