objectstore

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShouldShutDown = errors.New("controller should shut down")
)

Functions

This section is empty.

Types

type DynamicCache

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

DynamicCache is a cache based on the dynamic shared informer factory.

func NewDynamicCache

func NewDynamicCache(client cluster.ClientInterface, stopCh <-chan struct{}, options ...DynamicCacheOpt) (*DynamicCache, error)

NewDynamicCache creates an instance of DynamicCache.

func (*DynamicCache) Get

Get retrieves a single object.

func (*DynamicCache) HasAccess

func (dc *DynamicCache) HasAccess(ctx context.Context, key store.Key, verb string) error

HasAccess returns an error if the current user does not have access to perform the verb action for the given key.

func (*DynamicCache) List

List lists objects.

func (*DynamicCache) OnUpdate

func (dc *DynamicCache) OnUpdate() <-chan store.Store

func (*DynamicCache) RegisterOnUpdate

func (dc *DynamicCache) RegisterOnUpdate(fn store.UpdateFn)

func (*DynamicCache) Update

func (dc *DynamicCache) Update(ctx context.Context, key store.Key, updater func(*unstructured.Unstructured) error) error

func (*DynamicCache) UpdateClusterClient

func (dc *DynamicCache) UpdateClusterClient(ctx context.Context, client cluster.ClientInterface) error

UpdateClusterClient updates the cluster client.

func (*DynamicCache) Watch

func (dc *DynamicCache) Watch(ctx context.Context, key store.Key, handler kcache.ResourceEventHandler) error

Watch watches the cluster for an event and performs actions with the supplied handler.

type DynamicCacheOpt

type DynamicCacheOpt func(*DynamicCache)

DynamicCacheOpt is an option for configuration DynamicCache.

type Watch

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

Watch is a cache which watches the cluster for updates to known objects. It wraps a dynamic cache by default. Since the cache knows about all cluster updates, a majority of operations for listing and getting objects can happen in local memory instead of requiring a network request.

func NewWatch

func NewWatch(ctx context.Context, client cluster.ClientInterface, options ...WatchOpt) (*Watch, error)

NewWatch create an instance of new watch. By default, it will create a dynamic cache as its backend.

func (*Watch) Get

Get gets an object using a key.

func (*Watch) HasAccess

func (w *Watch) HasAccess(ctx context.Context, key store.Key, verb string) error

HasAccess access to objects using a key

func (*Watch) List

func (w *Watch) List(ctx context.Context, key store.Key) ([]*unstructured.Unstructured, error)

List lists objects using a key.

func (*Watch) RegisterOnUpdate

func (w *Watch) RegisterOnUpdate(fn store.UpdateFn)

func (*Watch) Update

func (w *Watch) Update(ctx context.Context, key store.Key, updater func(*unstructured.Unstructured) error) error

Update defers the update to the backend store.

func (*Watch) UpdateClusterClient

func (w *Watch) UpdateClusterClient(ctx context.Context, client cluster.ClientInterface) error

UpdateClusterClient updates the cluster client.

func (*Watch) Watch

func (w *Watch) Watch(ctx context.Context, key store.Key, handler kcache.ResourceEventHandler) error

Watch watches the cluster given a key and a handler.

type WatchOpt

type WatchOpt func(*Watch)

WatchOpt is an option for configuration Watch.

Jump to

Keyboard shortcuts

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