watchers

package
v0.0.0-...-0d671b9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package watchers is a generated GoMock package.

Package watchers is a generated GoMock package.

Package watchers is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidTrigger

type InvalidTrigger struct {
	Err error
}

InvalidTrigger describe an error returned when the trigger is invalid

func (InvalidTrigger) Error

func (e InvalidTrigger) Error() string

type MockRuleWatcher

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

MockRuleWatcher is a mock of RuleWatcher interface

func NewMockRuleWatcher

func NewMockRuleWatcher(ctrl *gomock.Controller) *MockRuleWatcher

NewMockRuleWatcher creates a new mock instance

func (*MockRuleWatcher) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRuleWatcher) Start

func (m *MockRuleWatcher) Start(arg0 context.Context)

Start mocks base method

type MockRuleWatcherFactory

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

MockRuleWatcherFactory is a mock of RuleWatcherFactory interface

func NewMockRuleWatcherFactory

func NewMockRuleWatcherFactory(ctrl *gomock.Controller) *MockRuleWatcherFactory

NewMockRuleWatcherFactory creates a new mock instance

func (*MockRuleWatcherFactory) Create

Create mocks base method

func (*MockRuleWatcherFactory) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockRuleWatcherFactoryMockRecorder

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

MockRuleWatcherFactoryMockRecorder is the mock recorder for MockRuleWatcherFactory

func (*MockRuleWatcherFactoryMockRecorder) Create

func (mr *MockRuleWatcherFactoryMockRecorder) Create(arg0 interface{}) *gomock.Call

Create indicates an expected call of Create

type MockRuleWatcherMockRecorder

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

MockRuleWatcherMockRecorder is the mock recorder for MockRuleWatcher

func (*MockRuleWatcherMockRecorder) Start

func (mr *MockRuleWatcherMockRecorder) Start(arg0 interface{}) *gomock.Call

Start indicates an expected call of Start

type MockTriggerWatcher

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

MockTriggerWatcher is a mock of TriggerWatcher interface

func NewMockTriggerWatcher

func NewMockTriggerWatcher(ctrl *gomock.Controller) *MockTriggerWatcher

NewMockTriggerWatcher creates a new mock instance

func (*MockTriggerWatcher) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockTriggerWatcher) Start

func (m *MockTriggerWatcher) Start(arg0 context.Context)

Start mocks base method

func (*MockTriggerWatcher) UpdateLastExecuted

func (m *MockTriggerWatcher) UpdateLastExecuted(arg0 time.Time) error

UpdateLastExecuted mocks base method

type MockTriggerWatcherFactory

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

MockTriggerWatcherFactory is a mock of TriggerWatcherFactory interface

func NewMockTriggerWatcherFactory

func NewMockTriggerWatcherFactory(ctrl *gomock.Controller) *MockTriggerWatcherFactory

NewMockTriggerWatcherFactory creates a new mock instance

func (*MockTriggerWatcherFactory) Create

func (m *MockTriggerWatcherFactory) Create(arg0 models.Trigger, arg1 []models.Target, arg2 time.Time, arg3 chan<- TriggerEvent, arg4 chan<- error) (TriggerWatcher, error)

Create mocks base method

func (*MockTriggerWatcherFactory) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockTriggerWatcherFactoryMockRecorder

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

MockTriggerWatcherFactoryMockRecorder is the mock recorder for MockTriggerWatcherFactory

func (*MockTriggerWatcherFactoryMockRecorder) Create

func (mr *MockTriggerWatcherFactoryMockRecorder) Create(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

Create indicates an expected call of Create

type MockTriggerWatcherMockRecorder

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

MockTriggerWatcherMockRecorder is the mock recorder for MockTriggerWatcher

func (*MockTriggerWatcherMockRecorder) Start

func (mr *MockTriggerWatcherMockRecorder) Start(arg0 interface{}) *gomock.Call

Start indicates an expected call of Start

func (*MockTriggerWatcherMockRecorder) UpdateLastExecuted

func (mr *MockTriggerWatcherMockRecorder) UpdateLastExecuted(arg0 interface{}) *gomock.Call

UpdateLastExecuted indicates an expected call of UpdateLastExecuted

type RuleWatcher

type RuleWatcher interface {
	Start(context.Context)
}

RuleWatcher defines methods to implement a rule watcher. It is responsible of monitoring the rule trigger(s), and execute the rule action when the trigger conditions are met.

type RuleWatcherFactory

type RuleWatcherFactory interface {
	Create(models.Rule) RuleWatcher
}

RuleWatcherFactory allows to create RuleWatchers

func NewRuleWatcherFactory

func NewRuleWatcherFactory(
	ruleWriter services.RuleWriter,
	triggerWatcherFactory TriggerWatcherFactory,
	actionFactory actions.ActionFactory,
	errorChan chan<- error,
	logger log.FieldLogger,
) RuleWatcherFactory

NewRuleWatcherFactory creates a new RuleWatcherFactory

type TriggerEvent

type TriggerEvent struct {
	Trigger models.Trigger
	Time    time.Time
}

TriggerEvent holds values transmitted when a trigger trigger

type TriggerWatcher

type TriggerWatcher interface {
	Start(context.Context)
	UpdateLastExecuted(time.Time) error
}

TriggerWatcher defines an interface for types watching on a trigger

type TriggerWatcherFactory

type TriggerWatcherFactory interface {
	Create(
		trigger models.Trigger,
		targets []models.Target,
		lastExecuted time.Time,
		triggeredChan chan<- TriggerEvent,
		errorChan chan<- error,
	) (TriggerWatcher, error)
}

TriggerWatcherFactory allows to create trigger watchers from a given trigger independently of the trigger type

func NewTriggerWatcherFactory

func NewTriggerWatcherFactory(
	streamListenerFactory events.StreamListenerFactory,
	triggerStateService services.TriggerStateService,
	validator models.TriggerValidator,
	logger log.FieldLogger,
) TriggerWatcherFactory

NewTriggerWatcherFactory creates a new watcher factory for given trigger

Jump to

Keyboard shortcuts

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