-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
76 lines (58 loc) · 1.41 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package jqdatatables
type JqTableColumnDirection string
const (
ORDER_ASC JqTableColumnDirection = "asc"
ORDER_DESC JqTableColumnDirection = "desc"
)
func (d JqTableColumnDirection) Valid() bool {
return d == ORDER_ASC || d == ORDER_DESC
}
//jQuery DataTable request model
type JqTableRequest struct {
//Number of current draw action (serial)
Draw int
//Ammount of records to skip
Start int
//Ammount of records to take
Length int
//Columns information from the script
Columns []*JqTableColumn
//Columns ordering information from the script
Order []*JqTableOrder
//Current search parameters
Search JqTableSearch
}
//jQuery DataTable table column model
type JqTableColumn struct {
Index int
Data string
Name string
Searchable bool
Orderable bool
Search JqTableSearch
}
//jQuery DataTable order model
type JqTableOrder struct {
//Order
Index int
//Column index
ColumnIndex int
//JqDataTable column instance
Column *JqTableColumn
//Sorting direction
Direction JqTableColumnDirection
}
//jQuery DataTables table search model
type JqTableSearch struct {
//Value to search
Value string
//Set if we should use regular expression
Regex bool
}
//JQuery DataTables object source response
type JqTableResponse struct {
Draw int `json:"draw"`
RecordsTotal int `json:"recordsTotal"`
RecordsFiltered int `json:"recordsFiltered"`
Data interface{} `json:"data"`
}