Documentation
¶
Index ¶
- Variables
- type DynamicCache
- func (dc *DynamicCache) Get(ctx context.Context, key store.Key) (*unstructured.Unstructured, error)
- func (dc *DynamicCache) HasAccess(ctx context.Context, key store.Key, verb string) error
- func (dc *DynamicCache) List(ctx context.Context, key store.Key) ([]*unstructured.Unstructured, error)
- func (dc *DynamicCache) OnUpdate() <-chan store.Store
- func (dc *DynamicCache) RegisterOnUpdate(fn store.UpdateFn)
- func (dc *DynamicCache) Update(ctx context.Context, key store.Key, ...) error
- func (dc *DynamicCache) UpdateClusterClient(ctx context.Context, client cluster.ClientInterface) error
- func (dc *DynamicCache) Watch(ctx context.Context, key store.Key, handler kcache.ResourceEventHandler) error
- type DynamicCacheOpt
- type Watch
- func (w *Watch) Get(ctx context.Context, key store.Key) (*unstructured.Unstructured, error)
- func (w *Watch) HasAccess(ctx context.Context, key store.Key, verb string) error
- func (w *Watch) List(ctx context.Context, key store.Key) ([]*unstructured.Unstructured, error)
- func (w *Watch) RegisterOnUpdate(fn store.UpdateFn)
- func (w *Watch) Update(ctx context.Context, key store.Key, ...) error
- func (w *Watch) UpdateClusterClient(ctx context.Context, client cluster.ClientInterface) error
- func (w *Watch) Watch(ctx context.Context, key store.Key, handler kcache.ResourceEventHandler) error
- type WatchOpt
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (dc *DynamicCache) Get(ctx context.Context, key store.Key) (*unstructured.Unstructured, error)
Get retrieves a single object.
func (*DynamicCache) HasAccess ¶
HasAccess returns an error if the current user does not have access to perform the verb action for the given key.
func (*DynamicCache) List ¶
func (dc *DynamicCache) List(ctx context.Context, key store.Key) ([]*unstructured.Unstructured, error)
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 ¶
func (w *Watch) Get(ctx context.Context, key store.Key) (*unstructured.Unstructured, error)
Get gets an object 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 (*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 ¶
UpdateClusterClient updates the cluster client.