filter

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Approver

type Approver interface {
	Approve(req *http.Request) (bool, []string)
}

Approver check the response of specified request need to go through filter or not. and get all filters' names for the specified request.

type FilterFinder added in v1.7.0

type FilterFinder interface {
	FindResponseFilter(req *http.Request) (ResponseFilter, bool)
	FindObjectFilter(req *http.Request) (ObjectFilter, bool)
	ResourceSyncer
}

type Initializer added in v1.3.0

type Initializer interface {
	Initialize(filter ObjectFilter) error
}

type NodeGetter

type NodeGetter func(name string) (*v1.Node, error)

type NodesInPoolGetter added in v1.5.0

type NodesInPoolGetter func(poolName string) ([]string, error)

type ObjectFilter added in v1.3.0

type ObjectFilter interface {
	Name() string
	// Filter is used for filtering runtime object
	// all filter logic should be located in it.
	Filter(obj runtime.Object, stopCh <-chan struct{}) runtime.Object
}

ObjectFilter is used for filtering runtime object. runtime object is only a standalone object(like Service). Every Filter need to implement ObjectFilter interface.

type ResourceSyncer added in v1.7.0

type ResourceSyncer interface {
	HasSynced() bool
}

ResourceSyncer is used for verifying the resources which filter depends on has been synced or not. For example: servicetopology filter depends on service and nodebucket metadata, filter can be worked before all these metadata has been synced completely.

type ResponseFilter added in v1.3.0

type ResponseFilter interface {
	Name() string
	// Filter is used to filter data returned from the cloud.
	Filter(req *http.Request, rc io.ReadCloser, stopCh <-chan struct{}) (int, io.ReadCloser, error)
}

ResponseFilter is used for filtering response for get/list/watch requests. it only prepares the common framework for ObjectFilter and don't cover the filter logic.

Jump to

Keyboard shortcuts

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