opa

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OPAChecker

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

func NewOPAChecker

func NewOPAChecker(batchSize int, workers int) *OPAChecker

func (*OPAChecker) VailOpaRulesResult

func (oc *OPAChecker) VailOpaRulesResult(rulesManager *RulesManager, resourcesManager *ResourcesManager) (v1alpha2.KubeeyeOpaResult, error)

type ResourceCollector

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

func NewResourceCollector

func NewResourceCollector(config *rest.Config) (*ResourceCollector, error)

func (*ResourceCollector) CollectMultipleResources

func (rc *ResourceCollector) CollectMultipleResources(resources []struct {
	Kind    string
	Version string
}) (map[string][]unstructured.Unstructured, error)

collect multiple resources

func (*ResourceCollector) CollectResources

func (rc *ResourceCollector) CollectResources(kind, version string) ([]unstructured.Unstructured, error)

func (*ResourceCollector) CollectResourcesWithFilter

func (rc *ResourceCollector) CollectResourcesWithFilter(kind, version string, filter ResourceFilter) ([]unstructured.Unstructured, error)

type ResourceFilter

type ResourceFilter struct {
	NamespaceSelector []string // filter by namespace
	LabelSelector     string   // filter by label
	FieldSelector     string   // filter by field
	Names             []string // filter by resource name
	ExcludeNames      []string // exclude resource name
}

collect resources with filter

type ResourcesManager

type ResourcesManager struct {
	Resources map[string][]unstructured.Unstructured
}

func NewResourcesManager

func NewResourcesManager() *ResourcesManager

func (*ResourcesManager) AddResource

func (rm *ResourcesManager) AddResource(resource string, collector *ResourceCollector) error

type RulesManager

type RulesManager struct {
	Rules map[string][]*v1alpha2.OpaRule
}

func NewRulesManager

func NewRulesManager() *RulesManager

func (*RulesManager) AddRule

func (rm *RulesManager) AddRule(rule *v1alpha2.OpaRule) error

Jump to

Keyboard shortcuts

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