ast.go

 1package ast
 2
 3import "github.com/MichaelMure/git-bug/bug"
 4
 5type Query struct {
 6	Filters
 7	OrderBy
 8	OrderDirection
 9}
10
11// NewQuery return an identity query with the default sorting (creation-desc).
12func NewQuery() *Query {
13	return &Query{
14		OrderBy:        OrderByCreation,
15		OrderDirection: OrderDescending,
16	}
17}
18
19// Filters is a collection of Filter that implement a complex filter
20type Filters struct {
21	Status      []bug.Status
22	Author      []string
23	Actor       []string
24	Participant []string
25	Label       []string
26	Title       []string
27	NoLabel     bool
28}
29
30type OrderBy int
31
32const (
33	_ OrderBy = iota
34	OrderById
35	OrderByCreation
36	OrderByEdit
37)
38
39type OrderDirection int
40
41const (
42	_ OrderDirection = iota
43	OrderAscending
44	OrderDescending
45)