filter

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 5 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 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
	// SupportedResourceAndVerbs is used to specify which resource and request verb is supported by the filter.
	// Because each filter can make sure what requests with resource and verb can be handled.
	SupportedResourceAndVerbs() map[string]sets.Set[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 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