cache

package
v0.0.0-...-2e893ec Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventQueue

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

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) ListKeys

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

ListKeys returns all enqueued keys.

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) 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

Jump to

Keyboard shortcuts

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