cache

package
v0.0.0-...-4d083f9 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageStreamReferenceIndex = "imagestreamref"
)

Variables

This section is empty.

Functions

func ImageStreamReferenceIndexFunc

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

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

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

func (eq *EventQueue) ListConsumed() bool

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

func (*EventQueue) ListCount

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

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

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

type EventQueueStopped struct{}

func (EventQueueStopped) Error

func (es EventQueueStopped) Error() string

type IndexerToClusterResourceQuotaLister

type IndexerToClusterResourceQuotaLister struct {
	cache.Indexer
}

func (*IndexerToClusterResourceQuotaLister) Get

func (*IndexerToClusterResourceQuotaLister) List

type IndexerToSecurityContextConstraintsLister

type IndexerToSecurityContextConstraintsLister struct {
	cache.Indexer
}

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

func (*IndexerToSecurityContextConstraintsLister) Get

func (*IndexerToSecurityContextConstraintsLister) List

List all SecurityContextConstraints in the store.

type InformerToClusterPolicyBindingLister

type InformerToClusterPolicyBindingLister struct {
	cache.SharedIndexInformer
}

func (*InformerToClusterPolicyBindingLister) ClusterPolicyBindings

func (*InformerToClusterPolicyBindingLister) Get

func (*InformerToClusterPolicyBindingLister) LastSyncResourceVersion

func (i *InformerToClusterPolicyBindingLister) LastSyncResourceVersion() string

LastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector

func (*InformerToClusterPolicyBindingLister) List

type InformerToClusterPolicyLister

type InformerToClusterPolicyLister struct {
	cache.SharedIndexInformer
}

func (*InformerToClusterPolicyLister) ClusterPolicies

func (*InformerToClusterPolicyLister) Get

func (*InformerToClusterPolicyLister) LastSyncResourceVersion

func (i *InformerToClusterPolicyLister) LastSyncResourceVersion() string

LastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector

func (*InformerToClusterPolicyLister) List

type InformerToPolicyBindingNamespacer

type InformerToPolicyBindingNamespacer struct {
	cache.SharedIndexInformer
}

func (*InformerToPolicyBindingNamespacer) LastSyncResourceVersion

func (i *InformerToPolicyBindingNamespacer) LastSyncResourceVersion() string

LastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector

func (*InformerToPolicyBindingNamespacer) PolicyBindings

type InformerToPolicyNamespacer

type InformerToPolicyNamespacer struct {
	cache.SharedIndexInformer
}

func (*InformerToPolicyNamespacer) LastSyncResourceVersion

func (i *InformerToPolicyNamespacer) LastSyncResourceVersion() string

LastSyncResourceVersion exposes the LastSyncResourceVersion of the internal reflector

func (*InformerToPolicyNamespacer) Policies

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

type StoreToBuildConfigLister

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

type StoreToBuildConfigListerImpl struct {
	cache.Indexer
}

StoreToBuildConfigListerImpl implements a StoreToBuildConfigLister

func (*StoreToBuildConfigListerImpl) BuildConfigs

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

func (*StoreToBuildConfigListerImpl) GetConfigsForImageStreamTrigger

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

List all buildconfigs in the store.

type StoreToBuildLister

type StoreToBuildLister struct {
	Indexer kcache.Indexer
}

StoreToBuildLister gives a store a List method. The store must contain only builds.

func (*StoreToBuildLister) Builds

func (s *StoreToBuildLister) Builds(namespace string) storeBuildsNamespacer

func (*StoreToBuildLister) List

func (s *StoreToBuildLister) List() ([]*buildapi.Build, error)

List all builds in the store.

type StoreToDeploymentConfigLister

type StoreToDeploymentConfigLister struct {
	cache.Indexer
}

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

func (*StoreToDeploymentConfigLister) DeploymentConfigs

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

func (*StoreToDeploymentConfigLister) GetConfigForController

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

func (*StoreToDeploymentConfigLister) GetConfigForPod

GetConfigForPod returns the managing deployment config for the provided pod.

func (*StoreToDeploymentConfigLister) GetConfigsForImageStream

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

List all deploymentconfigs in the store.

type StoreToImageStreamLister

type StoreToImageStreamLister struct {
	cache.Indexer
}

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

func (*StoreToImageStreamLister) GetStreamsForConfig

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

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

func (*StoreToImageStreamLister) List

List all image streams in the store.

type StoreToServiceAccountLister

type StoreToServiceAccountLister struct {
	cache.Indexer
}

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

func (*StoreToServiceAccountLister) ServiceAccounts

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