Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoLoader is the error returned when no Loader is set and Diff is set to true ErrNoLoader = errors.New("You must give a non nil Loader to the poll diff watcher") // ErrAlreadyClosed is the error returned when trying to close an already closed PollDiffWatcher ErrAlreadyClosed = errors.New("PollDiffWatcher already closed") // ErrNoWatcherSupplied is the error returned when Watch in general config is false but a watcher is still being registered ErrNoWatcherSupplied = errors.New("watcher has to be supplied when registering a watcher") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Rater is the rater the PollWatcher calls to get the duration until the next tick Rater Rater // Debug sets the debug mode Debug bool // Logger is the logger used to log debug messages Logger nlogger.Provider // Diff tells whether we should check for diffs // If diff is set, a Getter is required Diff bool // Loader is a loader to fetch data to check diff Loader konfig.Loader // InitValue is the initial value to compare with whe Diff is true InitValue konfig.Values }
Config is the config of a PollWatcher
type PollWatcher ¶
type PollWatcher struct {
// contains filtered or unexported fields
}
PollWatcher is a konfig.Watcher that sends events every x time given in the konfig.
func (*PollWatcher) Done ¶
func (t *PollWatcher) Done() <-chan struct{}
Done indicates whether the watcher is done or not
func (*PollWatcher) Watch ¶
func (t *PollWatcher) Watch() <-chan struct{}
Watch returns the channel to which events are written
Click to show internal directories.
Click to hide internal directories.