filters

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	// ComponentNameFilterType defines the type of a component name filter
	ComponentNameFilterType = "ComponentNameFilter"

	// ResourceTypeFilterType defines the type of a resource type filter
	ResourceTypeFilterType = "ResourceTypeFilter"

	// AccessTypeFilterType defines the type of a access type filter
	AccessTypeFilterType = "AccessTypeFilter"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTypeFilterSpec

type AccessTypeFilterSpec struct {
	IncludeAccessTypes []string `json:"includeAccessTypes"`
}

type ComponentNameFilterSpec

type ComponentNameFilterSpec struct {
	IncludeComponentNames []string
}

type Filter

type Filter interface {
	// Matches matches a component descriptor and a resource against the filter
	Matches(cdv2.ComponentDescriptor, cdv2.Resource) bool
}

Filter defines the interface for matching component resources with downloaders, processing rules, and uploaders

func NewAccessTypeFilter

func NewAccessTypeFilter(spec AccessTypeFilterSpec) (Filter, error)

NewAccessTypeFilter creates a new accessTypeFilter

func NewComponentNameFilter

func NewComponentNameFilter(spec ComponentNameFilterSpec) (Filter, error)

NewComponentNameFilter creates a new componentNameFilter

func NewResourceTypeFilter

func NewResourceTypeFilter(spec ResourceTypeFilterSpec) (Filter, error)

NewResourceTypeFilter creates a new resourceTypeFilter

type FilterFactory

type FilterFactory struct{}

FilterFactory defines a helper struct for creating filters

func NewFilterFactory

func NewFilterFactory() *FilterFactory

NewFilterFactory creates a new filter factory How to add a new filter: - Add Go file to filters package which contains the source code of the new filter - Add string constant for new filter type -> will be used in FilterFactory.Create() - Add source code for creating new filter to FilterFactory.Create() method

func (*FilterFactory) Create

func (f *FilterFactory) Create(filterType string, spec *json.RawMessage) (Filter, error)

Create creates a new filter defined by a type and a spec

type ResourceTypeFilterSpec

type ResourceTypeFilterSpec struct {
	IncludeResourceTypes []string `json:"includeResourceTypes"`
}

Jump to

Keyboard shortcuts

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