Documentation ¶
Index ¶
- Constants
- func FromCells(cells []DataCell, list IList)
- func ToResourceList(list IList, data interface{}, cellConvertF convertF, dsQuery *DataSelectQuery) error
- type ChartDataCell
- type ComparableValue
- type DataCell
- func NewChartDataCell(obj interface{}) (DataCell, error)
- func NewHelmReleaseDataCell(obj interface{}) (DataCell, error)
- func NewNamespaceDataCell(obj interface{}) (DataCell, error)
- func NewNamespacePodStatusDataCell(obj interface{}) (DataCell, error)
- func NewPVCDataCell(obj interface{}) (DataCell, error)
- func NewResourceDataCell(obj interface{}) (DataCell, error)
- func NewSecretDataCell(obj interface{}) (DataCell, error)
- func NewServiceDataCell(obj interface{}) (DataCell, error)
- func ToCells(data interface{}, cf convertF) ([]DataCell, error)
- type DataSelectQuery
- type DataSelector
- func (s *DataSelector) Data() []DataCell
- func (s *DataSelector) Filter() *DataSelector
- func (s DataSelector) Len() int
- func (s DataSelector) Less(i, j int) bool
- func (s *DataSelector) Limit() *DataSelector
- func (s *DataSelector) ListMeta() api.ListMeta
- func (s *DataSelector) Offset() *DataSelector
- func (s *DataSelector) Sort() *DataSelector
- func (s DataSelector) Swap(i, j int)
- type FilterBy
- type FilterQuery
- type HelmReleaseDataCell
- type IList
- type LimitQuery
- type ListMeta
- type NamespaceDataCell
- type NamespacePodStatusDataCell
- type OffsetQuery
- type PVCDataCell
- type PropertyName
- type ResourceDataCell
- type SecretDataCell
- type ServiceDataCell
- type SortBy
- type SortQuery
- type StdComparableEqualString
- type StdComparableInt
- type StdComparableRFC3339Timestamp
- type StdComparableString
- type StdComparableTime
Constants ¶
const ( NameProperty = "name" CreationTimestampProperty = "creationTimestamp" NamespaceProperty = "namespace" StatusProperty = "status" SecretTypeProperty = "type" PVCUnusedProperty = "unused" ServiceTypeProperty = "type" )
Variables ¶
This section is empty.
Functions ¶
func ToResourceList ¶
func ToResourceList(list IList, data interface{}, cellConvertF convertF, dsQuery *DataSelectQuery) error
Types ¶
type ChartDataCell ¶
type ChartDataCell struct {
Chart *api.ChartResult
}
func (ChartDataCell) GetObject ¶
func (cell ChartDataCell) GetObject() interface{}
func (ChartDataCell) GetProperty ¶
func (cell ChartDataCell) GetProperty(name PropertyName) ComparableValue
type ComparableValue ¶
type ComparableValue interface { // Compares self with other value. Returns 1 if other value is smaller, 0 if they are the same, -1 if other is larger Compare(ComparableValue) int // Returns true if self value contains or is equal to other value, false otherwise Contains(ComparableValue) bool }
type DataCell ¶
type DataCell interface { GetProperty(PropertyName) ComparableValue // Return the origin wrappered data GetObject() interface{} }
func NewChartDataCell ¶
func NewHelmReleaseDataCell ¶
func NewNamespaceDataCell ¶
func NewPVCDataCell ¶
func NewResourceDataCell ¶
func NewSecretDataCell ¶
func NewServiceDataCell ¶
type DataSelectQuery ¶
type DataSelectQuery struct { SortQuery *SortQuery FilterQuery *FilterQuery LimitQuery *LimitQuery OffsetQuery *OffsetQuery }
func DefaultDataSelect ¶
func DefaultDataSelect() *DataSelectQuery
func NewDataSelectQuery ¶
func NewDataSelectQuery( sortQuery *SortQuery, filterQuery *FilterQuery, limitQuery *LimitQuery, offsetQuery *OffsetQuery, ) *DataSelectQuery
func NoDataSelect ¶
func NoDataSelect() *DataSelectQuery
type DataSelector ¶
type DataSelector struct { Total int // GenericDataList hold generic data cells that are being selected GenericDataList []DataCell // DataSelectQuery holds the instructions for data select DataSelectQuery *DataSelectQuery }
func GenericDataSelector ¶
func GenericDataSelector(dataList []DataCell, dsQuery *DataSelectQuery) *DataSelector
func (*DataSelector) Data ¶
func (s *DataSelector) Data() []DataCell
func (*DataSelector) Filter ¶
func (s *DataSelector) Filter() *DataSelector
Filter the data inside as instructed by DataSelectQuery and returns itself to allow mehtod chaining
func (DataSelector) Len ¶
func (s DataSelector) Len() int
Len returns the length of data inside SelectableData
func (DataSelector) Less ¶
func (s DataSelector) Less(i, j int) bool
Less compares 2 indices inside SelectableData and returns true if first index is larger
func (*DataSelector) Limit ¶
func (s *DataSelector) Limit() *DataSelector
func (*DataSelector) ListMeta ¶
func (s *DataSelector) ListMeta() api.ListMeta
func (*DataSelector) Offset ¶
func (s *DataSelector) Offset() *DataSelector
func (*DataSelector) Sort ¶
func (s *DataSelector) Sort() *DataSelector
Sort sorts the data inside as instructed by DataSelectQuery and returns itself to allow method chaining
func (DataSelector) Swap ¶
func (s DataSelector) Swap(i, j int)
Swap swaps 2 indices inside SelectableData
type FilterBy ¶
type FilterBy struct { Property PropertyName Value ComparableValue }
func NewFilterBy ¶
type FilterQuery ¶
type FilterQuery struct {
FilterByList []FilterBy
}
func NewFilterQuery ¶
func NewFilterQuery(filterByListRaw []string) *FilterQuery
NewFilterQuery takes raw filter options list and returns FilterQuery object. For example: ["paramter1", "value1", "parameter2", "value2"] - means that the data should be filtered by parameter1 equals value1 and parameter2 equals value2
func NoFilter ¶
func NoFilter() *FilterQuery
func (*FilterQuery) Append ¶
func (f *FilterQuery) Append(filters ...FilterBy) *FilterQuery
type HelmReleaseDataCell ¶
func (HelmReleaseDataCell) GetObject ¶
func (cell HelmReleaseDataCell) GetObject() interface{}
func (HelmReleaseDataCell) GetProperty ¶
func (cell HelmReleaseDataCell) GetProperty(name PropertyName) ComparableValue
type LimitQuery ¶
type LimitQuery struct {
Limit int
}
func NewLimitQuery ¶
func NewLimitQuery(limit int) *LimitQuery
func NoLimiter ¶
func NoLimiter() *LimitQuery
type ListMeta ¶
func NewListMeta ¶
func NewListMeta() *ListMeta
type NamespaceDataCell ¶
type NamespaceDataCell struct {
ResourceDataCell
}
func (NamespaceDataCell) GetProperty ¶
func (cell NamespaceDataCell) GetProperty(name PropertyName) ComparableValue
type NamespacePodStatusDataCell ¶
type NamespacePodStatusDataCell struct { NamespaceDataCell Status v1.PodStatus }
func (NamespacePodStatusDataCell) GetProperty ¶
func (cell NamespacePodStatusDataCell) GetProperty(name PropertyName) ComparableValue
type OffsetQuery ¶
type OffsetQuery struct {
Offset int
}
func NewOffsetQuery ¶
func NewOffsetQuery(offset int) *OffsetQuery
func NoOffset ¶
func NoOffset() *OffsetQuery
type PVCDataCell ¶
type PVCDataCell struct { NamespaceDataCell Unused string // "true" or "false" }
func (PVCDataCell) GetProperty ¶
func (cell PVCDataCell) GetProperty(name PropertyName) ComparableValue
type PropertyName ¶
type PropertyName string
type ResourceDataCell ¶
type ResourceDataCell struct { ObjectMeta metaV1.ObjectMeta Object interface{} }
func (ResourceDataCell) GetObject ¶
func (cell ResourceDataCell) GetObject() interface{}
func (ResourceDataCell) GetProperty ¶
func (cell ResourceDataCell) GetProperty(name PropertyName) ComparableValue
type SecretDataCell ¶
type SecretDataCell struct { NamespaceDataCell Type v1.SecretType }
func (SecretDataCell) GetProperty ¶
func (cell SecretDataCell) GetProperty(name PropertyName) ComparableValue
type ServiceDataCell ¶
type ServiceDataCell struct { NamespaceDataCell Type v1.ServiceType }
func (ServiceDataCell) GetProperty ¶
func (cell ServiceDataCell) GetProperty(name PropertyName) ComparableValue
type SortBy ¶
type SortBy struct { Property PropertyName Ascending bool }
type SortQuery ¶
type SortQuery struct {
SortByList []SortBy
}
func NewSortQuery ¶
NewSortQuery takes raw sort options list and returns SortQuery object. For example: ["a", "parameter1", "d", "parameter2"] - means that the data should be sorted by parameter1 (Ascending) and lster - for results that return equal under parameter1 sort - by parameter2 (Descending)
type StdComparableEqualString ¶
type StdComparableEqualString struct {
StdComparableString
}
func (StdComparableEqualString) Contains ¶
func (self StdComparableEqualString) Contains(otherV ComparableValue) bool
type StdComparableInt ¶
type StdComparableInt int
func (StdComparableInt) Compare ¶
func (self StdComparableInt) Compare(otherV ComparableValue) int
func (StdComparableInt) Contains ¶
func (self StdComparableInt) Contains(otherV ComparableValue) bool
type StdComparableRFC3339Timestamp ¶
type StdComparableRFC3339Timestamp string
StdComparableRFC3339Timestamp takes RFC3339 Timestamp strings and compares them as TIMES. In case of time parsing error compares values as strings.
func (StdComparableRFC3339Timestamp) Compare ¶
func (self StdComparableRFC3339Timestamp) Compare(otherV ComparableValue) int
func (StdComparableRFC3339Timestamp) Contains ¶
func (self StdComparableRFC3339Timestamp) Contains(otherV ComparableValue) bool
type StdComparableString ¶
type StdComparableString string
func (StdComparableString) Compare ¶
func (self StdComparableString) Compare(otherV ComparableValue) int
func (StdComparableString) Contains ¶
func (self StdComparableString) Contains(otherV ComparableValue) bool
type StdComparableTime ¶
func (StdComparableTime) Compare ¶
func (self StdComparableTime) Compare(otherV ComparableValue) int
func (StdComparableTime) Contains ¶
func (self StdComparableTime) Contains(otherV ComparableValue) bool