Documentation ¶
Index ¶
- Constants
- type Event
- type EventType
- type FakeWatcher
- func (f *FakeWatcher) Action(action EventType, obj runtime.Object)
- func (f *FakeWatcher) Add(obj runtime.Object)
- func (f *FakeWatcher) Delete(lastValue runtime.Object)
- func (f *FakeWatcher) Error(errValue runtime.Object)
- func (f *FakeWatcher) IsStopped() bool
- func (f *FakeWatcher) Modify(obj runtime.Object)
- func (f *FakeWatcher) Reset()
- func (f *FakeWatcher) ResultChan() <-chan Event
- func (f *FakeWatcher) Stop()
- type Interface
- type RaceFreeFakeWatcher
- func (f *RaceFreeFakeWatcher) Action(action EventType, obj runtime.Object)
- func (f *RaceFreeFakeWatcher) Add(obj runtime.Object)
- func (f *RaceFreeFakeWatcher) Delete(lastValue runtime.Object)
- func (f *RaceFreeFakeWatcher) Error(errValue runtime.Object)
- func (f *RaceFreeFakeWatcher) IsStopped() bool
- func (f *RaceFreeFakeWatcher) Modify(obj runtime.Object)
- func (f *RaceFreeFakeWatcher) Reset()
- func (f *RaceFreeFakeWatcher) ResultChan() <-chan Event
- func (f *RaceFreeFakeWatcher) Stop()
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Type EventType // Object is: // * If Type is Added or Modified: the new state of the object. // * If Type is Deleted: the state of the object immediately before deletion. // * If Type is Error: *api.Status is recommended; other types may make sense // depending on context. Object runtime.Object }
Event represents a single event to a watched resource.
type FakeWatcher ¶
FakeWatcher lets you test anything that consumes a watch.Interface; threadsafe.
func NewFake ¶
func NewFake() *FakeWatcher
func NewFakeWithChanSize ¶
func NewFakeWithChanSize(size int, blocking bool) *FakeWatcher
func (*FakeWatcher) Action ¶
func (f *FakeWatcher) Action(action EventType, obj runtime.Object)
Action sends an event of the requested type, for table-based testing.
func (*FakeWatcher) Delete ¶
func (f *FakeWatcher) Delete(lastValue runtime.Object)
Delete sends a delete event.
func (*FakeWatcher) Error ¶
func (f *FakeWatcher) Error(errValue runtime.Object)
Error sends an Error event.
func (*FakeWatcher) IsStopped ¶
func (f *FakeWatcher) IsStopped() bool
func (*FakeWatcher) Modify ¶
func (f *FakeWatcher) Modify(obj runtime.Object)
Modify sends a modify event.
func (*FakeWatcher) ResultChan ¶
func (f *FakeWatcher) ResultChan() <-chan Event
type Interface ¶
type Interface interface { // Stops watching. Will close the channel returned by ResultChan(). Releases // any resources used by the watch. Stop() // Returns a chan which will receive all the events. If an error occurs // or Stop() is called, this channel will be closed, in which case the // watch should be completely cleaned up. ResultChan() <-chan Event }
Interface can be implemented by anything that knows how to watch and report changes.
func NewEmptyWatch ¶
func NewEmptyWatch() Interface
NewEmptyWatch returns a watch interface that returns no results and is closed. May be used in certain error conditions where no information is available but an error is not warranted.
type RaceFreeFakeWatcher ¶
type RaceFreeFakeWatcher struct { Stopped bool sync.Mutex // contains filtered or unexported fields }
RaceFreeFakeWatcher lets you test anything that consumes a watch.Interface; threadsafe.
func NewRaceFreeFake ¶
func NewRaceFreeFake() *RaceFreeFakeWatcher
func (*RaceFreeFakeWatcher) Action ¶
func (f *RaceFreeFakeWatcher) Action(action EventType, obj runtime.Object)
Action sends an event of the requested type, for table-based testing.
func (*RaceFreeFakeWatcher) Add ¶
func (f *RaceFreeFakeWatcher) Add(obj runtime.Object)
Add sends an add event.
func (*RaceFreeFakeWatcher) Delete ¶
func (f *RaceFreeFakeWatcher) Delete(lastValue runtime.Object)
Delete sends a delete event.
func (*RaceFreeFakeWatcher) Error ¶
func (f *RaceFreeFakeWatcher) Error(errValue runtime.Object)
Error sends an Error event.
func (*RaceFreeFakeWatcher) IsStopped ¶
func (f *RaceFreeFakeWatcher) IsStopped() bool
func (*RaceFreeFakeWatcher) Modify ¶
func (f *RaceFreeFakeWatcher) Modify(obj runtime.Object)
Modify sends a modify event.
func (*RaceFreeFakeWatcher) Reset ¶
func (f *RaceFreeFakeWatcher) Reset()
Reset prepares the watcher to be reused.
func (*RaceFreeFakeWatcher) ResultChan ¶
func (f *RaceFreeFakeWatcher) ResultChan() <-chan Event
func (*RaceFreeFakeWatcher) Stop ¶
func (f *RaceFreeFakeWatcher) Stop()
Stop implements Interface.Stop().