{"modulePath":"github.phpd.cn/openshift/origin","version":"v3.6.1+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cache\n\n## Constants\n\n```go\nconst (\n\tImageStreamReferenceIndex = \"imagestreamref\"\n)\n```\n\n## Functions\n\n```go\nfunc ImageStreamReferenceIndexFunc(obj interface{}) ([]string, error)\n```\nImageStreamReferenceIndexFunc is a default index function that indexes based on image stream references.\n\n## Types\n\n```go\ntype EventQueue struct {\n\t// contains filtered or unexported fields\n}\n```\nEventQueue 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:\n\n 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)\n\n 2. 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\n\n 3. 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)\n\n 4. If a watch.Modified is enqueued with state X and a watch.Deleted is received, these are compressed into (Deleted, X)\n\nIt 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.\n\nThis 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).\n\n```go\nfunc NewEventQueue(keyFn kcache.KeyFunc) *EventQueue\n```\nNewEventQueue returns a new EventQueue.\n\n```go\nfunc NewEventQueueForStore(keyFn kcache.KeyFunc, store kcache.Store) *EventQueue\n```\nNewEventQueueForStore returns a new EventQueue that uses the provided store.\n\n```go\nfunc (eq *EventQueue) Add(obj interface{}) error\n```\nAdd enqueues a watch.Added event for the given state.\n\n```go\nfunc (eq *EventQueue) Cancel()\n```\nCancel function to force Pop function to unblock\n\n```go\nfunc (eq *EventQueue) ContainedIDs() sets.String\n```\nContainedIDs 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.\n\n```go\nfunc (eq *EventQueue) Delete(obj interface{}) error\n```\nDelete enqueues a watch.Delete event for the given object.\n\n```go\nfunc (eq *EventQueue) Get(obj interface{}) (item interface{}, exists bool, err error)\n```\nGet returns the requested item, or sets exists=false.\n\n```go\nfunc (eq *EventQueue) GetByKey(key string) (item interface{}, exists bool, err error)\n```\nGetByKey returns the requested item, or sets exists=false.\n\n```go\nfunc (eq *EventQueue) List() []interface{}\n```\nList returns a list of all enqueued items.\n\n```go\nfunc (eq *EventQueue) ListConsumed() bool\n```\nListConsumed indicates whether the items queued by a List/Relist operation have been consumed.\n\n```go\nfunc (eq *EventQueue) ListCount() int\n```\nListCount returns how many objects were queued by the most recent List operation.\n\n```go\nfunc (eq *EventQueue) ListKeys() []string\n```\nListKeys returns all enqueued keys.\n\n```go\nfunc (eq *EventQueue) ListSuccessfulAtLeastOnce() bool\n```\nListSuccessfulAtLeastOnce indicates whether a List operation was successfully completed regardless of whether any items were queued.\n\n```go\nfunc (eq *EventQueue) Pop() (watch.EventType, interface{}, error)\n```\nPop 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.\n\n```go\nfunc (eq *EventQueue) Replace(objects []interface{}, resourceVersion string) error\n```\nReplace 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.\n\n```go\nfunc (eq *EventQueue) Resync() error\n```\nResync will touch all objects to put them into the processing queue\n\n```go\nfunc (eq *EventQueue) Update(obj interface{}) error\n```\nUpdate enqueues a watch.Modified event for the given state.\n\n```go\ntype EventQueueStopped struct{}\n```\n\n```go\nfunc (es EventQueueStopped) Error() string\n```\n\n```go\ntype IndexerToClusterResourceQuotaLister struct {\n\tcache.Indexer\n}\n```\n\n```go\nfunc (i *IndexerToClusterResourceQuotaLister) Get(name string) (*quotaapi.ClusterResourceQuota, error)\n```\n\n```go\nfunc (i *IndexerToClusterResourceQuotaLister) List(options metav1.ListOptions) ([]*quotaapi.ClusterResourceQuota, error)\n```\n\n```go\ntype InformerToClusterPolicyBindingLister struct {\n\tcache.SharedIndexInformer\n}\n```\n\n```go\nfunc (i *InformerToClusterPolicyBindingLister) ClusterPolicyBindings() client.ClusterPolicyBindingLister\n```\n\n```go\nfunc (i *InformerToClusterPolicyBindingLister) Get(name string, options metav1.GetOptions) (*authorizationapi.ClusterPolicyBinding, error)\n```\n\n```go\nfunc (i *InformerToClusterPolicyBindingLister) LastSyncResourceVersion() string\n```\nLastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector\n\n```go\nfunc (i *InformerToClusterPolicyBindingLister) List(options metav1.ListOptions) (*authorizationapi.ClusterPolicyBindingList, error)\n```\n\n```go\ntype InformerToClusterPolicyLister struct {\n\tcache.SharedIndexInformer\n}\n```\n\n```go\nfunc (i *InformerToClusterPolicyLister) ClusterPolicies() client.ClusterPolicyLister\n```\n\n```go\nfunc (i *InformerToClusterPolicyLister) Get(name string, options metav1.GetOptions) (*authorizationapi.ClusterPolicy, error)\n```\n\n```go\nfunc (i *InformerToClusterPolicyLister) LastSyncResourceVersion() string\n```\nLastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector\n\n```go\nfunc (i *InformerToClusterPolicyLister) List(options metav1.ListOptions) (*authorizationapi.ClusterPolicyList, error)\n```\n\n```go\ntype InformerToPolicyBindingNamespacer struct {\n\tcache.SharedIndexInformer\n}\n```\n\n```go\nfunc (i *InformerToPolicyBindingNamespacer) LastSyncResourceVersion() string\n```\nLastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector\n\n```go\nfunc (i *InformerToPolicyBindingNamespacer) PolicyBindings(namespace string) client.PolicyBindingLister\n```\n\n```go\ntype InformerToPolicyNamespacer struct {\n\tcache.SharedIndexInformer\n}\n```\n\n```go\nfunc (i *InformerToPolicyNamespacer) LastSyncResourceVersion() string\n```\nLastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector\n\n```go\nfunc (i *InformerToPolicyNamespacer) Policies(namespace string) client.PolicyLister\n```\n\n```go\ntype StoreToDeploymentConfigLister struct {\n\tcache.Indexer\n}\n```\nStoreToDeploymentConfigLister gives a store List and Exists methods. The store must contain only deploymentconfigs.\n\n```go\nfunc (s *StoreToDeploymentConfigLister) DeploymentConfigs(namespace string) storeDeploymentConfigsNamespacer\n```\n\n```go\nfunc (s *StoreToDeploymentConfigLister) GetConfigForController(rc *v1.ReplicationController) (*deployapi.DeploymentConfig, error)\n```\nGetConfigForController returns the managing deployment config for the provided replication controller.\n\n```go\nfunc (s *StoreToDeploymentConfigLister) GetConfigForPod(pod *v1.Pod) (*deployapi.DeploymentConfig, error)\n```\nGetConfigForPod returns the managing deployment config for the provided pod.\n\n```go\nfunc (s *StoreToDeploymentConfigLister) GetConfigsForImageStream(stream *imageapi.ImageStream) ([]*deployapi.DeploymentConfig, error)\n```\nGetConfigsForImageStream 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).\n\n```go\nfunc (s *StoreToDeploymentConfigLister) List() ([]*deployapi.DeploymentConfig, error)\n```\nList all deploymentconfigs in the store.\n\n```go\ntype StoreToImageStreamLister struct {\n\tcache.Indexer\n}\n```\nStoreToImageStreamLister gives a store List and Exists methods. The store must contain only image streams.\n\n```go\nfunc (s *StoreToImageStreamLister) GetStreamsForConfig(config *deployapi.DeploymentConfig) []*imageapi.ImageStream\n```\nGetStreamsForConfig returns all the image streams that the provided deployment config points to.\n\n```go\nfunc (s *StoreToImageStreamLister) ImageStreams(namespace string) storeImageStreamsNamespacer\n```\n\n```go\nfunc (s *StoreToImageStreamLister) List() ([]*imageapi.ImageStream, error)\n```\nList all image streams in the store.\n\n```go\ntype StoreToServiceAccountLister struct {\n\tcache.Indexer\n}\n```\nStoreToServiceAccountLister gives a store List and Exists methods. The store must contain only ServiceAccounts.\n\n```go\nfunc (s *StoreToServiceAccountLister) ServiceAccounts(namespace string) storeServiceAccountsNamespacer\n```\n\n","path":"github.phpd.cn/openshift/origin/pkg/client/cache","name":"cache","synopsis":"","isRedistributable":true}
