-
Notifications
You must be signed in to change notification settings - Fork 833
/
datastructures.go
36 lines (32 loc) · 1.51 KB
/
datastructures.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
package v1
import (
"time"
"github.com/kubescape/kubescape/v2/core/cautils/getter"
)
type V2ListRequest struct {
// properties of the requested next page
// Use ValidatePageProperties to set PageSize field
PageSize *int `json:"pageSize,omitempty"`
// One can leave it empty for 0, then call ValidatePageProperties
PageNum *int `json:"pageNum,omitempty"`
// The time window of the list to return. Default: since - beginning of the time, until - now.
Since *time.Time `json:"since,omitempty"`
Until *time.Time `json:"until,omitempty"`
// Which elements of the list to return, each field can hold multiple values separated by comma
// Example: ": {"severity": "High,Medium", "type": "61539,30303"}
// An empty map means "return the complete list"
InnerFilters []map[string]string `json:"innerFilters,omitempty"`
// How to order (sort) the list, field name + sort order (asc/desc), like https://www.w3schools.com/sql/sql_orderby.asp
// Example: "timestamp:asc,severity:desc"
OrderBy string `json:"orderBy,omitempty"`
// Cursor to the next page of former request. Not supported yet
// Cursor cannot be used with another parameters of this struct
Cursor string `json:"cursor,omitempty"`
// FieldsList allow us to return only subset of the source document fields
// Don't expose FieldsList outside without well designed decision
FieldsList []string `json:"includeFields,omitempty"`
FieldsReverseKeywordMap map[string]string `json:"-,omitempty"`
}
type KSCivAdaptor struct {
ksCloudAPI *getter.KSCloudAPI
}