models.go 921 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. )
  9. type Hit struct {
  10. Id int64 `json:"id"`
  11. Title string `json:"title"`
  12. Uri string `json:"uri"`
  13. Type HitType `json:"type"`
  14. Tags []string `json:"tags"`
  15. IsStarred bool `json:"isStarred"`
  16. }
  17. type HitList []*Hit
  18. func (s HitList) Len() int { return len(s) }
  19. func (s HitList) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
  20. func (s HitList) Less(i, j int) bool { return s[i].Title < s[j].Title }
  21. type Query struct {
  22. Title string
  23. Tags []string
  24. OrgId int64
  25. UserId int64
  26. Limit int
  27. IsStarred bool
  28. Result HitList
  29. }
  30. type FindPersistedDashboardsQuery struct {
  31. Title string
  32. OrgId int64
  33. UserId int64
  34. IsStarred bool
  35. Result HitList
  36. }