apiwatch

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIResourceInformer

func NewAPIResourceInformer(ctx context.Context, clusterName string, client upstreamdiscovery.DiscoveryInterface, invalidationNotifiers ...ObjectNotifier) (upstreamcache.SharedInformer, APIResourceLister, Invalidatable)

NewAPIResourceInformer creates an informer on the API resources revealed by the given client. The objects delivered by the informer are of type `*urmetav1a1.APIResource`.

The results from the given client are cached in memory and that cache has to be explicitly invalidated. Invalidation can be done by calling the returned Invalidator. Additionally, invalidation happens whenever any of the supplied invalidationNotifiers delivers a notification of an object addition. Re-querying the given client is delayed by a few decaseconds (with Nagling) to support invalidations based on events that merely trigger some process of changing the set of API resources.

Types

type APIResourceLister

type APIResourceLister interface {
	// List lists all APIResources in the informer.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*urmetav1a1.APIResource, err error)
	// Get retrieves the APIResource having the given name.
	// Objects returned here must be treated as read-only.
	Get(name string) (*urmetav1a1.APIResource, error)
}

APIResourceLister helps list APIResources. All objects returned here must be treated as read-only.

type Invalidatable

type Invalidatable interface {
	// Invalidate the cache
	Invalidate()
}

Invalidatable is a cache that has to be explicitly invalidated

type ObjectNotifier

type ObjectNotifier interface {
	AddEventHandler(handler upstreamcache.ResourceEventHandler)
}

ObjectNotifier is something that notifies the client like an informer does

Jump to

Keyboard shortcuts

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