objectvisitor

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIService added in v0.15.0

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

APIService is a typed visitor for apiservices.

func NewAPIService added in v0.15.0

func NewAPIService(os store.Store) *APIService

NewAPIService creates an instance of APIService.

func (*APIService) Supports added in v0.15.0

func (p *APIService) Supports() schema.GroupVersionKind

Support returns the gvk this typed visitor supports.

func (*APIService) Visit added in v0.15.0

func (p *APIService) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error

Visit visits a apiservice. It looks for service accounts and services.

type DefaultTypedVisitor

type DefaultTypedVisitor interface {
	Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error
}

DefaultTypedVisitor is the default typed visitors.

type DefaultVisitor

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

DefaultVisitor is the default implementation of Visitor.

func NewDefaultVisitor

func NewDefaultVisitor(dashConfig config.Dash, q queryer.Queryer, options ...DefaultVisitorOption) (*DefaultVisitor, error)

NewDefaultVisitor creates an instance of DefaultVisitor.

func (*DefaultVisitor) Visit

func (dv *DefaultVisitor) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitDescendants bool, level int) error

Visit visits a runtime.Object.

type DefaultVisitorOption

type DefaultVisitorOption func(*DefaultVisitor)

DefaultVisitorOption is an option for configuring DefaultVisitor.

func SetDefaultHandler

func SetDefaultHandler(dtv DefaultTypedVisitor) DefaultVisitorOption

SetDefaultHandler sets the default typed visitor for objects.

func SetTypedVisitors

func SetTypedVisitors(list []TypedVisitor) DefaultVisitorOption

SetTypedVisitors sets additional typed visitor for objects based on gvk.

type HorizontalPodAutoscaler

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

HorizontalPodAutoscaler is a typed visitor for services.

func NewHorizontalPodAutoscaler

func NewHorizontalPodAutoscaler(q queryer.Queryer) *HorizontalPodAutoscaler

NewHorizontalPodAutoscaler creates an instance of HorizontalPodAutoscaler

func (HorizontalPodAutoscaler) Supports

Supports returns the gvk this typed visitor supports.

func (*HorizontalPodAutoscaler) Visit

func (s *HorizontalPodAutoscaler) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error

Visit visits a hpa. It looks for an associated scale target (replication controllers, deployments, and replica sets)

type Ingress

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

Ingress is a typed visitor for ingress objects.

func NewIngress

func NewIngress(q queryer.Queryer) *Ingress

NewIngress creates Ingress.

func (*Ingress) Supports

func (i *Ingress) Supports() schema.GroupVersionKind

Supports returns the gvk this typed visitor supports.

func (*Ingress) Visit

func (i *Ingress) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error

Visit visits an ingress. It looks for associated services.

type MutatingWebhookConfiguration added in v0.15.0

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

MutatingWebhookConfiguration is a typed visitor for mutatingwebhookconfigurations.

func NewMutatingWebhookConfiguration added in v0.15.0

func NewMutatingWebhookConfiguration(os store.Store) *MutatingWebhookConfiguration

NewMutatingWebhookConfiguration creates an instance of MutatingWebhookConfiguration.

func (*MutatingWebhookConfiguration) Supports added in v0.15.0

Supports returns the gvk this typed visitor supports.

func (*MutatingWebhookConfiguration) Visit added in v0.15.0

func (p *MutatingWebhookConfiguration) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error

Visit visits a mutatingwebhookconfiguration. It looks for service accounts and services.

type Object

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

Object is the default visitor for an object.

func NewObject

func NewObject(dashConfig config.Dash, q queryer.Queryer) *Object

NewObject creates Object.

func (*Object) Visit

func (o *Object) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error

Visit visits an objects. It looks at immediate ancestors and descendants.

type ObjectHandler

type ObjectHandler interface {
	AddEdge(ctx context.Context, v1, v2 *unstructured.Unstructured, level int) error
	Process(ctx context.Context, object *unstructured.Unstructured) error
	SetLevel(objectKind string, level int) int
}

ObjectHandler performs actions on an object. Can be used to augment visitor actions with extra functionality.

type Pod

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

Pod is a typed visitor for pods.

func NewPod

func NewPod(q queryer.Queryer) *Pod

NewPod creates an instance of Pod.

func (*Pod) Supports

func (p *Pod) Supports() schema.GroupVersionKind

Support returns the gvk this typed visitor supports.

func (*Pod) Visit

func (p *Pod) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error

Visit visits a pod. It looks for service accounts and services.

type Service

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

Service is a typed visitor for services.

func NewService

func NewService(q queryer.Queryer) *Service

NewService creates an instance of Service.

func (Service) Supports

func (Service) Supports() schema.GroupVersionKind

Supports returns the gvk this typed visitor supports.

func (*Service) Visit

func (s *Service) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error

Visit visits a service. It looks for associated pods and ingresses.

type TypedVisitor

type TypedVisitor interface {
	DefaultTypedVisitor
	Supports() schema.GroupVersionKind
}

TypedVisitor is a typed visitor for a specific gvk.

type ValidatingWebhookConfiguration added in v0.15.0

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

ValidatingWebhookConfiguration is a typed visitor for validatingwebhookconfigurations.

func NewValidatingWebhookConfiguration added in v0.15.0

func NewValidatingWebhookConfiguration(os store.Store) *ValidatingWebhookConfiguration

NewValidatingWebhookConfiguration creates an instance of ValidatingWebhookConfiguration.

func (*ValidatingWebhookConfiguration) Supports added in v0.15.0

Supports returns the gvk this typed visitor supports.

func (*ValidatingWebhookConfiguration) Visit added in v0.15.0

func (p *ValidatingWebhookConfiguration) Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitor Visitor, visitDescendants bool, level int) error

Visit visits a validatingwebhookconfiguration. It looks for service accounts and services.

type Visitor

type Visitor interface {
	Visit(ctx context.Context, object *unstructured.Unstructured, handler ObjectHandler, visitDescendants bool, level int) error
}

Visitor is a visitor for cluster objects. It will visit an object and all of its ancestors and descendants.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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