cache

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCacheWatcher

func NewCacheWatcher(user user.Info, authCache WatchableCache, includeAllExistingResources bool) *cacheWatcher

Types

type AuthCache

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

func NewAuthCache

func NewAuthCache(clusterRoleInformer rbacv1informers.ClusterRoleInformer,
	clusterRolebindingInformer rbacv1informers.ClusterRoleBindingInformer,
	group, resource string,
	lastSyncResourceVersioner LastSyncResourceVersioner,
	syncResourcesFunc func() (sets.String, error),
) *AuthCache

func (*AuthCache) AddWatcher

func (ac *AuthCache) AddWatcher(watcher CacheWatcher)

func (*AuthCache) RemoveWatcher

func (ac *AuthCache) RemoveWatcher(watcher CacheWatcher)

type CacheWatcher

type CacheWatcher interface {
	// GroupMembershipChanged is called serially for all changes for all watchers.  This method MUST NOT BLOCK.
	// The serial nature makes reasoning about the code easy, but if you block in this method you will doom all watchers.
	GroupMembershipChanged(names, users, groups sets.String)
}

type ClusterCache

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

func NewClusterCache

func NewClusterCache(clusterInformer clusterinformerv1.ManagedClusterInformer,
	clusterRoleInformer rbacv1informers.ClusterRoleInformer,
	clusterRolebindingInformer rbacv1informers.ClusterRoleBindingInformer,
) *ClusterCache

func (*ClusterCache) AddWatcher

func (c *ClusterCache) AddWatcher(w CacheWatcher)

func (*ClusterCache) ConvertResource

func (c *ClusterCache) ConvertResource(name string) runtime.Object

func (*ClusterCache) Get

func (c *ClusterCache) Get(name string) (runtime.Object, error)

func (*ClusterCache) List

func (c *ClusterCache) List(userInfo user.Info, selector labels.Selector) (*clusterv1.ManagedClusterList, error)

func (*ClusterCache) ListObjects

func (c *ClusterCache) ListObjects(userInfo user.Info) (runtime.Object, error)

func (*ClusterCache) ListResources

func (c *ClusterCache) ListResources() (sets.String, error)

func (*ClusterCache) RemoveWatcher

func (c *ClusterCache) RemoveWatcher(w CacheWatcher)

func (*ClusterCache) Run

func (c *ClusterCache) Run(period time.Duration)

Run begins watching and synchronizing the cache

type ClusterLister

type ClusterLister interface {
	// List returns the list of ManagedCluster items that the user can access
	List(user user.Info, selector labels.Selector) (*clusterv1.ManagedClusterList, error)
}

ClusterLister enforces ability to enumerate cluster based on role

type ClusterSetCache

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

func NewClusterSetCache

func NewClusterSetCache(clusterSetInformer clusterinformerv1alpha1.ManagedClusterSetInformer,
	clusterRoleInformer rbacv1informers.ClusterRoleInformer,
	clusterRolebindingInformer rbacv1informers.ClusterRoleBindingInformer,
) *ClusterSetCache

func (*ClusterSetCache) AddWatcher

func (c *ClusterSetCache) AddWatcher(w CacheWatcher)

func (*ClusterSetCache) ConvertResource

func (c *ClusterSetCache) ConvertResource(name string) runtime.Object

func (*ClusterSetCache) Get

func (c *ClusterSetCache) Get(name string) (runtime.Object, error)

func (*ClusterSetCache) List

func (*ClusterSetCache) ListObjects

func (c *ClusterSetCache) ListObjects(userInfo user.Info) (runtime.Object, error)

func (*ClusterSetCache) ListResources

func (c *ClusterSetCache) ListResources() (sets.String, error)

func (*ClusterSetCache) RemoveWatcher

func (c *ClusterSetCache) RemoveWatcher(w CacheWatcher)

func (*ClusterSetCache) Run

func (c *ClusterSetCache) Run(period time.Duration)

Run begins watching and synchronizing the cache

type ClusterSetLister

type ClusterSetLister interface {
	// List returns the list of ManagedClusterSet items that the user can access
	List(user user.Info, selector labels.Selector) (*clusterv1alpha1.ManagedClusterSetList, error)
}

ClusterSetLister enforces ability to enumerate clusterSet based on role

type LastSyncResourceVersioner

type LastSyncResourceVersioner interface {
	LastSyncResourceVersion() string
}

LastSyncResourceVersioner is any object that can divulge a LastSyncResourceVersion

type SyncedClusterRoleLister

type SyncedClusterRoleLister interface {
	rbacv1listers.ClusterRoleLister
	LastSyncResourceVersioner
}

type WatchableCache

type WatchableCache interface {
	// RemoveWatcher removes a watcher
	RemoveWatcher(CacheWatcher)

	ListObjects(user user.Info) (runtime.Object, error)

	Get(name string) (runtime.Object, error)

	ConvertResource(name string) runtime.Object
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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