Documentation ¶
Index ¶
Constants ¶
View Source
const ( FieldName = "name" FieldAlias = "alias" FieldNames = "names" FieldUID = "uid" FieldCreationTimeStamp = "creationTimestamp" FieldCreateTime = "createTime" FieldLastUpdateTimestamp = "lastUpdateTimestamp" FieldUpdateTime = "updateTime" FieldLabel = "label" FieldAnnotation = "annotation" FieldNamespace = "namespace" FieldStatus = "status" FieldOwnerReference = "ownerReference" FieldOwnerKind = "ownerKind" FieldType = "type" )
View Source
const ( ParameterName = "name" ParameterLabelSelector = "labelSelector" ParameterFieldSelector = "fieldSelector" ParameterPage = "page" ParameterLimit = "limit" ParameterOrderBy = "sortBy" ParameterAscending = "ascending" )
Variables ¶
View Source
var ComparableFields = []Field{ FieldName, FieldUID, FieldLabel, FieldAnnotation, FieldNamespace, FieldStatus, FieldOwnerReference, FieldOwnerKind, }
Field contains all the query field that can be compared
View Source
var NoPagination = newPagination(-1, 0)
View Source
var SortableFields = []Field{ FieldCreationTimeStamp, FieldCreateTime, FieldUpdateTime, FieldLastUpdateTimestamp, FieldName, }
Functions ¶
This section is empty.
Types ¶
type Pagination ¶
func (*Pagination) GetValidPagination ¶
func (p *Pagination) GetValidPagination(total int) (startIndex, endIndex int)
type Query ¶
type Query struct { Pagination *Pagination // sort result in which field, default to FieldCreationTimeStamp SortBy Field // sort result in ascending or descending order, default to descending Ascending bool // Filters map[Field]Value LabelSelector string }
Query represents api search terms
func ParseQueryParameter ¶
func ParseQueryParameter(request *restful.Request) *Query
Click to show internal directories.
Click to hide internal directories.