watch

package
v0.0.0-...-56aa9b5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockWatcher

type MockWatcher struct {
	mock.Mock
}

MockWatcher is an autogenerated mock type for the Watcher type

func NewMockWatcher

func NewMockWatcher(t mockConstructorTestingTNewMockWatcher) *MockWatcher

NewMockWatcher creates a new instance of MockWatcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockWatcher) StopWatching

func (_m *MockWatcher) StopWatching(id cron.EntryID)

StopWatching provides a mock function with given fields: id

func (*MockWatcher) Watch

func (_m *MockWatcher) Watch(config WatchConfig) cron.EntryID

Watch provides a mock function with given fields: config

type WatchConfig

type WatchConfig struct {
	LookoutId int
	Name      string
	Query     string
	Cron      string
}

type WatchResult

type WatchResult struct {
	LookoutId int
	Result    query.QueryResult
	Error     error
}

type WatchResultPublisher

type WatchResultPublisher = observer.Publisher[WatchResult]

type WatchResultSubscriber

type WatchResultSubscriber = observer.Subscriber[WatchResult]

type Watcher

type Watcher interface {
	Watch(config WatchConfig) WatcherId
	StopWatching(id WatcherId)
}

func New

func New(resultNotifier WatchResultPublisher, queryRepo query.QueryRepo) Watcher

type WatcherId

type WatcherId = cron.EntryID

Jump to

Keyboard shortcuts

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