filter

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Labels      = "labels"
	Annotations = "annotations"
)

Variables

This section is empty.

Functions

func GetDeepFloat64

func GetDeepFloat64(item interface{}, keyStr string) (value float64)

GetDeepFloat64 get float64 value by metadata.xx.xx.xx, multi level key

func GetDeepValue

func GetDeepValue(item interface{}, keyStr string) ([]string, error)

GetDeepValue get value by metadata.xx.xx.xx, multi level key

Types

type ConverterContext

type ConverterContext struct {
	EnableConvert bool
	RawGvr        *schema.GroupVersionResource
	ConvertedGvr  *schema.GroupVersionResource
	Converter     *conversion.VersionConverter
}

type Filter

type Filter struct {
	Exact     map[string]string
	Fuzzy     map[string]string
	Limit     int
	Offset    int
	SortName  string
	SortOrder string
	SortFunc  string

	EnableFilter bool

	// ConverterContext holds methods to convert objects
	ConverterContext
}

Filter is the filter condition

func (*Filter) ConvertItems

func (f *Filter) ConvertItems(items ...interface{}) ([]interface{}, error)

ConvertItems converts items by given version

func (*Filter) FilterResult

func (f *Filter) FilterResult(body []byte) []byte

FilterResult filter result by exact/fuzzy match, sort, page

func (*Filter) FilterResultToMap

func (f *Filter) FilterResultToMap(body []byte) K8sJson

FilterResultToMap filter result by exact/fuzzy match, sort, page

func (*Filter) ModifyResponse

func (f *Filter) ModifyResponse(r *http.Response) error

ModifyResponse modify the response

type K8sJson

type K8sJson = map[string]interface{}

func GetDeepMap

func GetDeepMap(item interface{}, keyStr string) (value K8sJson)

GetDeepMap get map by spec.selector.matchLabels={xx= xx}

type K8sJsonArr

type K8sJsonArr = []interface{}

func GetDeepArray

func GetDeepArray(item interface{}, keyStr string) (value K8sJsonArr)

GetDeepArray get metadata.ownerReference[0]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL