cache

package
v1.5.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2017 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageStreamReferenceIndex string = "imagestreamref"
)

Variables

This section is empty.

Functions

func ImageStreamReferenceIndexFunc added in v1.3.0

func ImageStreamReferenceIndexFunc(obj interface{}) ([]string, error)

ImageStreamReferenceIndexFunc is a default index function that indexes based on image stream references.

Types

type EventQueue

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

EventQueue is a Store implementation that provides a sequence of compressed events to a consumer along with event types. This differs from the FIFO implementation in that FIFO does not provide events when an object is deleted and does not provide the type of event. Events are compressed in a manner similar to FIFO, but accounting for event types and deletions. The exact compression semantics are as follows:

  1. If a watch.Added is enqueued with state X and a watch.Modified with state Y is received, these are compressed into (Added, Y)
  1. If a watch.Added is enqueued with state X and a watch.Deleted is received, these are compressed and the item is removed from the queue
  1. If a watch.Modified is enqueued with state X and a watch.Modified with state Y is received, these two events are compressed into (Modified, Y)
  1. If a watch.Modified is enqueued with state X and a watch.Deleted is received, these are compressed into (Deleted, X)

It should be noted that the scenario where an object is deleted and re-added is not handled by this type nor is it in scope; the reflector uses UIDs for the IDs passed to stores, so you will never see a delete and a re-add for the same ID.

This type maintains a backing store in order to provide the deleted state on watch.Deleted events. This is necessary because the Store API does not receive the deleted state on a watch.Deleted event (though this state is delivered by the watch API itself, it is not passed on to the reflector Store).

func NewEventQueue

func NewEventQueue(keyFn kcache.KeyFunc) *EventQueue

NewEventQueue returns a new EventQueue.

func NewEventQueueForStore added in v1.0.6

func NewEventQueueForStore(keyFn kcache.KeyFunc, store kcache.Store) *EventQueue

NewEventQueueForStore returns a new EventQueue that uses the provided store.

func (*EventQueue) Add

func (eq *EventQueue) Add(obj interface{}) error

Add enqueues a watch.Added event for the given state.

func (*EventQueue) Cancel added in v1.0.6

func (eq *EventQueue) Cancel()

Cancel function to force Pop function to unblock

func (*EventQueue) ContainedIDs

func (eq *EventQueue) ContainedIDs() sets.String

ContainedIDs returns a sets.String containing all IDs of the enqueued items. This is a snapshot of a moment in time, and one should keep in mind that other go routines can add or remove items after you call this.

func (*EventQueue) Delete

func (eq *EventQueue) Delete(obj interface{}) error

Delete enqueues a watch.Delete event for the given object.

func (*EventQueue) Get

func (eq *EventQueue) Get(obj interface{}) (item interface{}, exists bool, err error)

Get returns the requested item, or sets exists=false.

func (*EventQueue) GetByKey

func (eq *EventQueue) GetByKey(key string) (item interface{}, exists bool, err error)

GetByKey returns the requested item, or sets exists=false.

func (*EventQueue) List

func (eq *EventQueue) List() []interface{}

List returns a list of all enqueued items.

func (*EventQueue) ListConsumed added in v1.3.0

func (eq *EventQueue) ListConsumed() bool

ListConsumed indicates whether the items queued by a List/Relist operation have been consumed.

func (*EventQueue) ListCount added in v1.5.0

func (eq *EventQueue) ListCount() int

ListCount returns how many objects were queued by the most recent List operation.

func (*EventQueue) ListKeys

func (eq *EventQueue) ListKeys() []string

ListKeys returns all enqueued keys.

func (*EventQueue) ListSuccessfulAtLeastOnce added in v1.5.0

func (eq *EventQueue) ListSuccessfulAtLeastOnce() bool

ListSuccessfulAtLeastOnce indicates whether a List operation was successfully completed regardless of whether any items were queued.

func (*EventQueue) Pop

func (eq *EventQueue) Pop() (watch.EventType, interface{}, error)

Pop gets the event and object at the head of the queue. If the event is a delete event, Pop deletes the key from the underlying cache.

func (*EventQueue) Replace

func (eq *EventQueue) Replace(objects []interface{}, resourceVersion string) error

Replace initializes 'eq' with the state contained in the given map and populates the queue with a watch.Modified event for each of the replaced objects. The backing store takes ownership of keyToObjs; you should not reference the map again after calling this function.

func (*EventQueue) Resync added in v1.3.0

func (eq *EventQueue) Resync() error

Resync will touch all objects to put them into the processing queue

func (*EventQueue) Update

func (eq *EventQueue) Update(obj interface{}) error

Update enqueues a watch.Modified event for the given state.

type EventQueueStopped added in v1.0.6

type EventQueueStopped struct{}

func (EventQueueStopped) Error added in v1.0.6

func (es EventQueueStopped) Error() string

type IndexerToClusterResourceQuotaLister added in v1.3.0

type IndexerToClusterResourceQuotaLister struct {
	cache.Indexer
}

func (*IndexerToClusterResourceQuotaLister) Get added in v1.3.0

func (*IndexerToClusterResourceQuotaLister) List added in v1.3.0

type IndexerToSecurityContextConstraintsLister added in v1.3.0

type IndexerToSecurityContextConstraintsLister struct {
	cache.Indexer
}

IndexerToSecurityContextConstraintsLister gives a store List and Exists methods. The store must contain only SecurityContextConstraints.

func (*IndexerToSecurityContextConstraintsLister) Get added in v1.3.0

func (*IndexerToSecurityContextConstraintsLister) List added in v1.3.0

List all SecurityContextConstraints in the store.

type InformerToClusterPolicyBindingLister added in v1.3.0

type InformerToClusterPolicyBindingLister struct {
	cache.SharedIndexInformer
}

func (*InformerToClusterPolicyBindingLister) ClusterPolicyBindings added in v1.3.0

func (*InformerToClusterPolicyBindingLister) Get added in v1.3.0

func (*InformerToClusterPolicyBindingLister) LastSyncResourceVersion added in v1.3.0

func (i *InformerToClusterPolicyBindingLister) LastSyncResourceVersion() string

LastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector

func (*InformerToClusterPolicyBindingLister) List added in v1.3.0

type InformerToClusterPolicyLister added in v1.3.0

type InformerToClusterPolicyLister struct {
	cache.SharedIndexInformer
}

func (*InformerToClusterPolicyLister) ClusterPolicies added in v1.3.0

func (*InformerToClusterPolicyLister) Get added in v1.3.0

func (*InformerToClusterPolicyLister) LastSyncResourceVersion added in v1.3.0

func (i *InformerToClusterPolicyLister) LastSyncResourceVersion() string

LastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector

func (*InformerToClusterPolicyLister) List added in v1.3.0

type InformerToPolicyBindingNamespacer added in v1.3.0

type InformerToPolicyBindingNamespacer struct {
	cache.SharedIndexInformer
}

func (*InformerToPolicyBindingNamespacer) LastSyncResourceVersion added in v1.3.0

func (i *InformerToPolicyBindingNamespacer) LastSyncResourceVersion() string

LastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector

func (*InformerToPolicyBindingNamespacer) PolicyBindings added in v1.3.0

type InformerToPolicyNamespacer added in v1.3.0

type InformerToPolicyNamespacer struct {
	cache.SharedIndexInformer
}

func (*InformerToPolicyNamespacer) LastSyncResourceVersion added in v1.3.0

func (i *InformerToPolicyNamespacer) LastSyncResourceVersion() string

LastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector

func (*InformerToPolicyNamespacer) Policies added in v1.3.0

func (i *InformerToPolicyNamespacer) Policies(namespace string) client.PolicyLister

type StoreToBuildConfigLister added in v1.4.0

type StoreToBuildConfigLister interface {
	List() ([]*buildapi.BuildConfig, error)
	GetConfigsForImageStreamTrigger(namespace, name string) ([]*buildapi.BuildConfig, error)
}

StoreToBuildConfigLister gives a store List and Exists methods. The store must contain only buildconfigs.

type StoreToBuildConfigListerImpl added in v1.4.0

type StoreToBuildConfigListerImpl struct {
	cache.Indexer
}

StoreToBuildConfigListerImpl implements a StoreToBuildConfigLister

func (*StoreToBuildConfigListerImpl) BuildConfigs added in v1.4.0

func (s *StoreToBuildConfigListerImpl) BuildConfigs(namespace string) storeBuildConfigsNamespacer

func (*StoreToBuildConfigListerImpl) GetConfigsForImageStreamTrigger added in v1.4.0

func (s *StoreToBuildConfigListerImpl) GetConfigsForImageStreamTrigger(namespace, name string) ([]*buildapi.BuildConfig, error)

GetConfigsForImageStream returns all the build configs that are triggered by the provided image stream by searching through using the ImageStreamReferenceIndex (build configs are indexed in the cache by image stream references).

func (*StoreToBuildConfigListerImpl) List added in v1.4.0

List all buildconfigs in the store.

type StoreToDeploymentConfigLister added in v1.3.0

type StoreToDeploymentConfigLister struct {
	cache.Indexer
}

StoreToDeploymentConfigLister gives a store List and Exists methods. The store must contain only deploymentconfigs.

func (*StoreToDeploymentConfigLister) DeploymentConfigs added in v1.3.0

func (s *StoreToDeploymentConfigLister) DeploymentConfigs(namespace string) storeDeploymentConfigsNamespacer

func (*StoreToDeploymentConfigLister) GetConfigForController added in v1.3.0

GetConfigForController returns the managing deployment config for the provided replication controller.

func (*StoreToDeploymentConfigLister) GetConfigForPod added in v1.3.0

GetConfigForPod returns the managing deployment config for the provided pod.

func (*StoreToDeploymentConfigLister) GetConfigsForImageStream added in v1.3.0

func (s *StoreToDeploymentConfigLister) GetConfigsForImageStream(stream *imageapi.ImageStream) ([]*deployapi.DeploymentConfig, error)

GetConfigsForImageStream returns all the deployment configs that point to the provided image stream by searching through using the ImageStreamReferenceIndex (deployment configs are indexed in the cache by namespace and by image stream references).

func (*StoreToDeploymentConfigLister) List added in v1.3.0

List all deploymentconfigs in the store.

type StoreToImageStreamLister added in v1.3.0

type StoreToImageStreamLister struct {
	cache.Indexer
}

StoreToImageStreamLister gives a store List and Exists methods. The store must contain only image streams.

func (*StoreToImageStreamLister) GetStreamsForConfig added in v1.3.0

func (s *StoreToImageStreamLister) GetStreamsForConfig(config *deployapi.DeploymentConfig) []*imageapi.ImageStream

GetStreamsForConfig returns all the image streams that the provided deployment config points to.

func (*StoreToImageStreamLister) ImageStreams added in v1.3.0

func (s *StoreToImageStreamLister) ImageStreams(namespace string) storeImageStreamsNamespacer

func (*StoreToImageStreamLister) List added in v1.3.0

List all image streams in the store.

type StoreToServiceAccountLister added in v1.4.0

type StoreToServiceAccountLister struct {
	cache.Indexer
}

StoreToServiceAccountLister gives a store List and Exists methods. The store must contain only ServiceAccounts.

func (*StoreToServiceAccountLister) ServiceAccounts added in v1.4.0

func (s *StoreToServiceAccountLister) ServiceAccounts(namespace string) storeServiceAccountsNamespacer

Jump to

Keyboard shortcuts

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