mirror of https://github.com/grafana/grafana
Major refactorings around searching, moved to seperate package, trying to move stuff out of models package, extend search support searching different types of entities and different types of dashboards, #960
parent
c8146e759f
commit
448a8b8d1c
@ -0,0 +1,47 @@ |
||||
package search |
||||
|
||||
type HitType string |
||||
|
||||
const ( |
||||
DashHitDB HitType = "dash-db" |
||||
DashHitHome HitType = "dash-home" |
||||
DashHitJson HitType = "dash-json" |
||||
DashHitScripted HitType = "dash-scripted" |
||||
) |
||||
|
||||
type Hit struct { |
||||
Id int64 `json:"id"` |
||||
Title string `json:"title"` |
||||
Uri string `json:"uri"` |
||||
Type HitType `json:"type"` |
||||
Tags []string `json:"tags"` |
||||
IsStarred bool `json:"isStarred"` |
||||
} |
||||
|
||||
type HitList []*Hit |
||||
|
||||
func (s HitList) Len() int { return len(s) } |
||||
func (s HitList) Swap(i, j int) { s[i], s[j] = s[j], s[i] } |
||||
func (s HitList) Less(i, j int) bool { return s[i].Title < s[j].Title } |
||||
|
||||
type Query struct { |
||||
Title string |
||||
Tag string |
||||
OrgId int64 |
||||
UserId int64 |
||||
Limit int |
||||
IsStarred bool |
||||
|
||||
Result HitList |
||||
} |
||||
|
||||
type FindPersistedDashboardsQuery struct { |
||||
Title string |
||||
Tag string |
||||
OrgId int64 |
||||
UserId int64 |
||||
Limit int |
||||
IsStarred bool |
||||
|
||||
Result HitList |
||||
} |
Loading…
Reference in new issue