Documentation ¶
Index ¶
- Constants
- Variables
- func AtoiOrDefault(str string, defVal int) int
- func GetBoolValueWithDefault(req *restful.Request, name string, dv bool) bool
- func GetInt64ValuePointerWithDefault(req *restful.Request, name string, dv int64) *int64
- func GetInt64ValueWithDefault(req *restful.Request, name string, dv int64) int64
- func GetIntValueWithDefault(req *restful.Request, name string, dv int) int
- func GetStringValueWithDefault(req *restful.Request, name string, dv string) string
- func GetWrapperBoolWithDefault(req *restful.Request, name string, dv *bool) *bool
- func IsInformerRawQuery(req *restful.Request) bool
- func ParsePaging(req *restful.Request) (limit, offset int)
- type Pagination
- type Query
Constants ¶
View Source
const ( PagingParam = "paging" ParameterName = "name" ParameterLabelSelector = "labelSelector" ParameterFieldSelector = "fieldSelector" ParameterContinue = "continue" ParameterLimit = "limit" ParameterWatch = "watch" ParameterAllowWatchBookMark = "allowWatchBookmarks" ParameterResourceVersion = "resourceVersion" ParameterResourceVersionMatch = "resourceVersionMatch" ParameterTimeoutSeconds = "timeoutSeconds" ParameterNode = "node" ParameterOperation = "operation" ParameterStep = "step" ParameterOffset = "offset" OrderByParam = "orderBy" ParamReverse = "reverse" ParamDryRun = "dryRun" ParamRole = "role" ParamOffline = "offline" ParameterSubDomain = "subdomain" ParameterFuzzySearch = "fuzzy" ParameterForce = "force" )
View Source
const ( DefaultLimit = 10 DefaultPage = 1 MinTimeoutSeconds = 1800 )
View Source
const ( ResourceVersionMatchNotOlderThan = "NotOlderThan" ResourceVersionMatchExact = "Exact" )
Variables ¶
View Source
var NoPagination = func() *Pagination {
return newPagination(-1, 0)
}
Functions ¶
func AtoiOrDefault ¶
func GetBoolValueWithDefault ¶
func GetIntValueWithDefault ¶
func IsInformerRawQuery ¶
func IsInformerRawQuery(req *restful.Request) bool
func ParsePaging ¶
func ParsePaging(req *restful.Request) (limit, offset int)
Types ¶
type Pagination ¶
func (*Pagination) GetValidPagination ¶
func (p *Pagination) GetValidPagination(total int) (startIndex, endIndex int)
type Query ¶
type Query struct { Pagination *Pagination TimeoutSeconds *int64 ResourceVersion string Watch bool LabelSelector string FieldSelector string Continue string Limit int64 Reverse bool // TODO: add orderby OrderBy string DryRun string AllowWatchBookmarks bool ResourceVersionMatch string FuzzySearch map[string]string }
Query represents api search terms
func NewFromRawQuery ¶
func ParseQueryParameter ¶
func ParseQueryParameter(request *restful.Request) *Query
func (*Query) AddLabelSelector ¶ added in v1.4.0
AddLabelSelector add labelSelector to query.
func (*Query) GetFieldSelector ¶
func (*Query) GetLabelSelector ¶
func (*Query) HasLabelSelector ¶ added in v1.4.0
HasLabelSelector check label is exist
Click to show internal directories.
Click to hide internal directories.