2018-03-29 22:02:24 +00:00
|
|
|
package table
|
|
|
|
|
2018-03-30 17:29:26 +00:00
|
|
|
// SortOrder int
|
2018-03-29 22:02:24 +00:00
|
|
|
type SortOrder int
|
2018-03-30 17:29:26 +00:00
|
|
|
|
|
|
|
// SortFn sort function
|
2018-03-29 22:02:24 +00:00
|
|
|
type SortFn func(interface{}, interface{}) bool
|
|
|
|
|
|
|
|
const (
|
2018-03-30 17:29:26 +00:00
|
|
|
// SortNone sort none
|
2018-03-29 22:02:24 +00:00
|
|
|
SortNone SortOrder = iota
|
2018-03-30 17:29:26 +00:00
|
|
|
// SortAsc sort ascendinge
|
2018-03-29 22:02:24 +00:00
|
|
|
SortAsc
|
2018-03-30 17:29:26 +00:00
|
|
|
// SortDesc sort descending
|
2018-03-29 22:02:24 +00:00
|
|
|
SortDesc
|
|
|
|
)
|
|
|
|
|
2018-03-30 17:29:26 +00:00
|
|
|
// SortBy sort by
|
2018-03-29 22:02:24 +00:00
|
|
|
type SortBy struct {
|
|
|
|
index int
|
|
|
|
order SortOrder
|
|
|
|
sortFn SortFn
|
|
|
|
}
|