mirror of
https://github.com/rancher/steve.git
synced 2025-09-05 01:12:09 +00:00
Sort-indirect PR broken into smaller parts: part 2/6 - fix the Sort part of ListOptions (#611)
* Move types related to list options and sql queries into their own package. The problem having these in the informer package is that eventually code in other packages will need to import `informer` only for constants or types, but some members of the informer package may already depend on those. Best to move type definitions into their own simpler package. * Fix the ListOptions sort field. Instead of making it a single array-ish field, convert it into a true array of Sort Directives. Easier to read, less bending backwards. * Rebasing (or human error) duplicated 'NewSortList'.
This commit is contained in:
@@ -28,7 +28,7 @@ type ListOptions struct {
|
||||
ChunkSize int
|
||||
Resume string
|
||||
Filters []OrFilter
|
||||
Sort Sort
|
||||
SortList SortList
|
||||
Pagination Pagination
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ type OrFilter struct {
|
||||
// The order is represented by prefixing the sort key by '-', e.g. sort=-metadata.name.
|
||||
// e.g. To sort internal clusters first followed by clusters in alpha order: sort=-spec.internal,spec.displayName
|
||||
type Sort struct {
|
||||
Fields [][]string
|
||||
Orders []SortOrder
|
||||
Fields []string
|
||||
Order SortOrder
|
||||
}
|
||||
|
||||
type SortList struct {
|
||||
|
Reference in New Issue
Block a user