watchertest

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotifyWatcher

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

func NewNotifyWatcher

func NewNotifyWatcher(ch <-chan struct{}) *NotifyWatcher

func (*NotifyWatcher) Changes

func (w *NotifyWatcher) Changes() <-chan struct{}

func (*NotifyWatcher) Err

func (w *NotifyWatcher) Err() error

func (*NotifyWatcher) Kill

func (w *NotifyWatcher) Kill()

func (*NotifyWatcher) KillErr

func (w *NotifyWatcher) KillErr(err error)

KillErr can be used to kill the worker with an error, to simulate a failing watcher.

func (*NotifyWatcher) Stop

func (w *NotifyWatcher) Stop() error

func (*NotifyWatcher) Wait

func (w *NotifyWatcher) Wait() error

type StringsWatcher

type StringsWatcher struct {
	T tomb.Tomb
	C chan []string
}

StringsWatcher is an implementation of state.StringsWatcher that can be manipulated, for testing.

func NewStringsWatcher

func NewStringsWatcher(ch chan []string) *StringsWatcher

NewStringsWatcher returns a new StringsWatcher that returns the given channel in its "Changes" method. NewStringsWatcher takes ownership of the channel, closing it when it is stopped.

func (*StringsWatcher) Changes

func (w *StringsWatcher) Changes() <-chan []string

Changes is part of the state.StringsWatcher interface.

func (*StringsWatcher) Err

func (w *StringsWatcher) Err() error

Err is part of the state.StringsWatcher interface.

func (*StringsWatcher) Kill

func (w *StringsWatcher) Kill()

Kill is part of the state.StringsWatcher interface.

func (*StringsWatcher) Stop

func (w *StringsWatcher) Stop() error

Stop is part of the state.StringsWatcher interface.

func (*StringsWatcher) Wait

func (w *StringsWatcher) Wait() error

Wait is part of the state.StringsWatcher interface.

Jump to

Keyboard shortcuts

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