resources

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2021 KubeCube Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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)

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

func GetDeepValue

func GetDeepValue(item interface{}, keyStr string) (value string)

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

Types

type Access

type Access struct {
	Cluster         string
	Name            string
	Operator        string
	APIGroup        string
	Namespace       string
	Resource        string
	ResourceRequest bool
}

func NewAccess

func NewAccess(clusterName string, userName string, operator string, apiGroup string, namespace string, resource string, isK8sRes bool) *Access

func NewSimpleAccess

func NewSimpleAccess(clusterName string, userName string, namespace string) *Access

func (*Access) AccessAllow

func (a *Access) AccessAllow(apiGroup string, resource string, operator string) bool

type Filter

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

func (*Filter) FilterResult

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

filter result by exact/fuzzy match, sort, page

func (*Filter) FilterResultToMap

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

filter result by exact/fuzzy match, sort, page

func (*Filter) ModifyResponse

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

modify the response

type K8sJson

type K8sJson = map[string]interface{}

func GetDeepMap

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

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

type K8sJsonArr

type K8sJsonArr = []interface{}

func GetDeepArray

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

get metadata.ownerReference[0]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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