query

package
v1.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName is provider name for install.
	ProviderName = "query"
	// HelmReleaseKind is the kind of HelmRelease
	HelmReleaseKind = "HelmRelease"
)

Variables

This section is empty.

Functions

func Install

func Install(p providers.Providers, cli client.Client)

Install register handlers to provider discover.

Types

type AppCollector

type AppCollector struct {
	// contains filtered or unexported fields
}

AppCollector collect resource created by application

func NewAppCollector

func NewAppCollector(cli client.Client, opt Option) *AppCollector

NewAppCollector create a app collector

func (*AppCollector) CollectResourceFromApp

func (c *AppCollector) CollectResourceFromApp() ([]Resource, error)

CollectResourceFromApp collect resources created by application

type FilterOption

type FilterOption struct {
	Cluster          string   `json:"cluster,omitempty"`
	ClusterNamespace string   `json:"clusterNamespace,omitempty"`
	Components       []string `json:"components,omitempty"`
}

FilterOption filter resource created by component

type HelmReleaseCollector

type HelmReleaseCollector struct {
	// contains filtered or unexported fields
}

HelmReleaseCollector HelmRelease resources collector

func NewHelmReleaseCollector

func NewHelmReleaseCollector(cli client.Client, hr *unstructured.Unstructured) *HelmReleaseCollector

NewHelmReleaseCollector create a HelmRelease collector

func (*HelmReleaseCollector) CollectWorkloads

func (c *HelmReleaseCollector) CollectWorkloads(cluster string) ([]*unstructured.Unstructured, error)

CollectWorkloads collect workloads of HelmRelease

type Option

type Option struct {
	Name      string       `json:"name"`
	Namespace string       `json:"namespace"`
	Filter    FilterOption `json:"filter,omitempty"`
}

Option is the query option

type PodCollector

type PodCollector func(cli client.Client, obj *unstructured.Unstructured, cluster string) ([]*unstructured.Unstructured, error)

PodCollector collector pod created by workload

func NewPodCollector

func NewPodCollector(gvk schema.GroupVersionKind) PodCollector

NewPodCollector create a PodCollector

type Resource

type Resource struct {
	Cluster   string                     `json:"cluster"`
	Component string                     `json:"component"`
	Revision  string                     `json:"revision"`
	Object    *unstructured.Unstructured `json:"object"`
}

Resource refer to an object with cluster info

Jump to

Keyboard shortcuts

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