eventStream

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeType

type ChangeType string

ChangeType defines the possible types of changes.

const (
	Added    ChangeType = "ADDED"
	Updated  ChangeType = "UPDATED"
	Deleted  ChangeType = "DELETED"
	Replaced ChangeType = "REPLACED"
)

type ChangedObject

type ChangedObject struct {
	Old interface{}
	New interface{}
}

type EventListWatch

type EventListWatch struct {
	ListFunc     cache.ListFunc
	WatchFunc    cache.WatchFunc
	OnChangeFunc OnChangeFunc
}

Holds callbacks to handle list/watch/change events from k8s

func (*EventListWatch) List

func (lw *EventListWatch) List(options api.ListOptions) (runtime.Object, error)

Implementations for EventListWatcher interface for EventListWatch

func (*EventListWatch) OnChange

func (lw *EventListWatch) OnChange(changeType ChangeType, obj interface{})

func (*EventListWatch) Watch

func (lw *EventListWatch) Watch(options api.ListOptions) (watch.Interface, error)

type EventListerWatcher

type EventListerWatcher interface {
	cache.ListerWatcher                              // provides listing and watching of k8s objects
	OnChange(changeType ChangeType, obj interface{}) // triggered on changes after they have been applied to the store
}

Extension of cacheListerWatcher that also requires OnChangeFunc

type EventStore

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

Storage for the current state of objects, gets updated by cache.Reflector, works with the cache.Store interface.

func NewEventStore

func NewEventStore(keyFunc cache.KeyFunc, onChangeFunc OnChangeFunc) *EventStore

func (*EventStore) Add

func (es *EventStore) Add(obj interface{}) error

Implementation of cache.Store interface for EventStore that also triggers events on a EventStoreListener. This is essentially the cache.Store implementation with the addition of calls to onChangeFunc().

func (*EventStore) Delete

func (es *EventStore) Delete(obj interface{}) error

func (*EventStore) Get

func (es *EventStore) Get(obj interface{}) (item interface{}, exists bool, err error)

func (*EventStore) GetByKey

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

func (*EventStore) List

func (es *EventStore) List() []interface{}

func (*EventStore) ListKeys

func (es *EventStore) ListKeys() []string

func (*EventStore) Replace

func (es *EventStore) Replace(list []interface{}, resourceVersion string) error

func (*EventStore) Resync

func (es *EventStore) Resync() error

func (*EventStore) Update

func (es *EventStore) Update(obj interface{}) error

type EventStream

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

Internal data required for cached events

func NewConfigMapEventStream

func NewConfigMapEventStream(core v1core.CoreInterface, namespace string, resyncPeriod time.Duration, onChangeFunc OnChangeFunc, labelSelector labels.Selector, fieldSelector fields.Selector) *EventStream

Creates a new EventStream for *v1.ConfigMap

func NewEndpointsEventStream

func NewEndpointsEventStream(core v1core.CoreInterface, namespace string, resyncPeriod time.Duration, onChangeFunc OnChangeFunc, labelSelector labels.Selector, fieldSelector fields.Selector) *EventStream

func NewEventStream

func NewEventStream(eventListWatch *EventListWatch, dataType interface{}, resyncPeriod time.Duration) *EventStream

Creates a new EventStream

func NewServiceEventStream

func NewServiceEventStream(core v1core.CoreInterface, namespace string, resyncPeriod time.Duration, onChangeFunc OnChangeFunc, labelSelector labels.Selector, fieldSelector fields.Selector) *EventStream

Creates a new EventStream for *v1.Service

func (*EventStream) Run

func (es *EventStream) Run()

func (*EventStream) Stop

func (es *EventStream) Stop()

func (*EventStream) Store

func (es *EventStream) Store() *EventStore

Implementations for EventStreamRunner interface for EventStream

type EventStreamRunner

type EventStreamRunner interface {
	Store() *EventStore
	Run()
	Stop()
}

Interface for external operations on an EventStream

type OnChangeFunc

type OnChangeFunc func(changeType ChangeType, obj interface{})

Function used to handle stream update events after the store is updated.

Jump to

Keyboard shortcuts

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