Documentation
¶
Overview ¶
Package events is a generated GoMock package.
Package events is a generated GoMock package.
Package events is a generated GoMock package.
Index ¶
- Variables
- type Dispatcher
- type Event
- type EventType
- type Factory
- type Listener
- type MockDispatcher
- type MockDispatcherMockRecorder
- func (mr *MockDispatcherMockRecorder) AddListener(arg0 interface{}) *gomock.Call
- func (mr *MockDispatcherMockRecorder) Dispatch(arg0 interface{}) *gomock.Call
- func (mr *MockDispatcherMockRecorder) Listeners() *gomock.Call
- func (mr *MockDispatcherMockRecorder) RemoveListener(arg0 interface{}) *gomock.Call
- type MockFactory
- type MockFactoryMockRecorder
- type MockListener
- type MockListenerMockRecorder
Constants ¶
This section is empty.
Variables ¶
var (
ErrListenerNotFound = errors.New("listener not found")
)
events errors
var (
// EventChanBufferSize is the maximum number of events to be retained on an listener event channel
EventChanBufferSize = 100
)
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface { AddListener(Listener) RemoveListener(Listener) error Listeners() []Listener Dispatch(Event) }
Dispatcher defines a component able to dispatch an event to all subscribed listeners
func NewDispatcher ¶
func NewDispatcher(logger log.FieldLogger) Dispatcher
NewDispatcher returns a new instance of an event dispatcher
type Factory ¶
type Factory interface { NewClientSubscribedEvent(source string, target string) Event NewClientUnsubscribedEvent(source string, target string) Event }
Factory allows to create events
type Listener ¶
Listener defines a type listening for events
func NewListener ¶
func NewListener(dispatcher Dispatcher) Listener
NewListener creates a new Listener and register it on the dispatcher It holds an internal buffered channel for events, of size EventChanBufferSize.
type MockDispatcher ¶
type MockDispatcher struct {
// contains filtered or unexported fields
}
MockDispatcher is a mock of Dispatcher interface
func NewMockDispatcher ¶
func NewMockDispatcher(ctrl *gomock.Controller) *MockDispatcher
NewMockDispatcher creates a new mock instance
func (*MockDispatcher) AddListener ¶
func (m *MockDispatcher) AddListener(arg0 Listener)
AddListener mocks base method
func (*MockDispatcher) Dispatch ¶
func (m *MockDispatcher) Dispatch(arg0 Event)
Dispatch mocks base method
func (*MockDispatcher) EXPECT ¶
func (m *MockDispatcher) EXPECT() *MockDispatcherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockDispatcher) Listeners ¶
func (m *MockDispatcher) Listeners() []Listener
Listeners mocks base method
func (*MockDispatcher) RemoveListener ¶
func (m *MockDispatcher) RemoveListener(arg0 Listener) error
RemoveListener mocks base method
type MockDispatcherMockRecorder ¶
type MockDispatcherMockRecorder struct {
// contains filtered or unexported fields
}
MockDispatcherMockRecorder is the mock recorder for MockDispatcher
func (*MockDispatcherMockRecorder) AddListener ¶
func (mr *MockDispatcherMockRecorder) AddListener(arg0 interface{}) *gomock.Call
AddListener indicates an expected call of AddListener
func (*MockDispatcherMockRecorder) Dispatch ¶
func (mr *MockDispatcherMockRecorder) Dispatch(arg0 interface{}) *gomock.Call
Dispatch indicates an expected call of Dispatch
func (*MockDispatcherMockRecorder) Listeners ¶
func (mr *MockDispatcherMockRecorder) Listeners() *gomock.Call
Listeners indicates an expected call of Listeners
func (*MockDispatcherMockRecorder) RemoveListener ¶
func (mr *MockDispatcherMockRecorder) RemoveListener(arg0 interface{}) *gomock.Call
RemoveListener indicates an expected call of RemoveListener
type MockFactory ¶
type MockFactory struct {
// contains filtered or unexported fields
}
MockFactory is a mock of Factory interface
func NewMockFactory ¶
func NewMockFactory(ctrl *gomock.Controller) *MockFactory
NewMockFactory creates a new mock instance
func (*MockFactory) EXPECT ¶
func (m *MockFactory) EXPECT() *MockFactoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockFactory) NewClientSubscribedEvent ¶
func (m *MockFactory) NewClientSubscribedEvent(arg0, arg1 string) Event
NewClientSubscribedEvent mocks base method
func (*MockFactory) NewClientUnsubscribedEvent ¶
func (m *MockFactory) NewClientUnsubscribedEvent(arg0, arg1 string) Event
NewClientUnsubscribedEvent mocks base method
type MockFactoryMockRecorder ¶
type MockFactoryMockRecorder struct {
// contains filtered or unexported fields
}
MockFactoryMockRecorder is the mock recorder for MockFactory
func (*MockFactoryMockRecorder) NewClientSubscribedEvent ¶
func (mr *MockFactoryMockRecorder) NewClientSubscribedEvent(arg0, arg1 interface{}) *gomock.Call
NewClientSubscribedEvent indicates an expected call of NewClientSubscribedEvent
func (*MockFactoryMockRecorder) NewClientUnsubscribedEvent ¶
func (mr *MockFactoryMockRecorder) NewClientUnsubscribedEvent(arg0, arg1 interface{}) *gomock.Call
NewClientUnsubscribedEvent indicates an expected call of NewClientUnsubscribedEvent
type MockListener ¶
type MockListener struct {
// contains filtered or unexported fields
}
MockListener is a mock of Listener interface
func NewMockListener ¶
func NewMockListener(ctrl *gomock.Controller) *MockListener
NewMockListener creates a new mock instance
func (*MockListener) EXPECT ¶
func (m *MockListener) EXPECT() *MockListenerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockListenerMockRecorder ¶
type MockListenerMockRecorder struct {
// contains filtered or unexported fields
}
MockListenerMockRecorder is the mock recorder for MockListener
func (*MockListenerMockRecorder) C ¶
func (mr *MockListenerMockRecorder) C() *gomock.Call
C indicates an expected call of C
func (*MockListenerMockRecorder) Close ¶
func (mr *MockListenerMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockListenerMockRecorder) Send ¶
func (mr *MockListenerMockRecorder) Send(arg0 interface{}) *gomock.Call
Send indicates an expected call of Send