watch

package
v0.0.0-...-34c5bf1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher struct {
	// LogDAO provides access to the log events
	LogRepository *repository.LogRepository
	// contains filtered or unexported fields
}

Watcher notifies subscribers of new events whenever the log file is written to

func (*Watcher) GetName

func (w *Watcher) GetName() string

GetName returns the name "watcher"

func (*Watcher) Start

func (w *Watcher) Start() error

Start begins watching for log file changes and notifies subscribers accordingly

func (*Watcher) Stop

func (w *Watcher) Stop(_ context.Context) error

Stop stops watching for log file changes

func (*Watcher) Subscribe

func (w *Watcher) Subscribe(c chan<- *domain.Event, q *repository.LogQuery) error

Subscribe starts sending all events that match the query over the given channel. The query will be updated with the a new SinceUUID value whenever events are published to the channel.

func (*Watcher) Unsubscribe

func (w *Watcher) Unsubscribe(c chan<- *domain.Event)

Unsubscribe stops publishing events to the channel but does not close the channel

Jump to

Keyboard shortcuts

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