Documentation ¶
Overview ¶
Package event is a generated GoMock package.
Index ¶
- Variables
- type Dispatcher
- type Event
- type Listener
- type MockDispatcher
- func (m *MockDispatcher) Dispatch(arg0 Event, arg1 any) error
- func (m *MockDispatcher) EXPECT() *MockDispatcherMockRecorder
- func (m *MockDispatcher) Forget(arg0 Event)
- func (m *MockDispatcher) GetListeners(arg0 Event) []Listener
- func (m *MockDispatcher) HasListeners(arg0 Event) bool
- func (m *MockDispatcher) List() map[Event][]Listener
- func (m *MockDispatcher) Listen(arg0 Event, arg1 Listener)
- func (m *MockDispatcher) Run(arg0 context.Context) error
- func (m *MockDispatcher) Shutdown(arg0 context.Context) error
- type MockDispatcherMockRecorder
- func (mr *MockDispatcherMockRecorder) Dispatch(arg0, arg1 any) *gomock.Call
- func (mr *MockDispatcherMockRecorder) Forget(arg0 any) *gomock.Call
- func (mr *MockDispatcherMockRecorder) GetListeners(arg0 any) *gomock.Call
- func (mr *MockDispatcherMockRecorder) HasListeners(arg0 any) *gomock.Call
- func (mr *MockDispatcherMockRecorder) List() *gomock.Call
- func (mr *MockDispatcherMockRecorder) Listen(arg0, arg1 any) *gomock.Call
- func (mr *MockDispatcherMockRecorder) Run(arg0 any) *gomock.Call
- func (mr *MockDispatcherMockRecorder) Shutdown(arg0 any) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
var WireEvent = wire.NewSet(NewDispatcher)
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface { // Listen Register an event listener with the dispatcher. Listen(Event, Listener) // HasListeners Determine if a given event has listeners. HasListeners(Event) bool // Dispatch Fire an event and call the listeners. Dispatch(Event, any) error // Forget Shutdown a set of listeners from the dispatcher. Forget(Event) // GetListeners get all listeners by GetListeners(Event) []Listener // Run server. Run(context.Context) error // Shutdown server. Shutdown(context.Context) error List() map[Event][]Listener }
func NewDispatcher ¶
func NewDispatcher(logger mlog.Logger) Dispatcher
NewDispatcher return Dispatcher.
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) Dispatch ¶
func (m *MockDispatcher) Dispatch(arg0 Event, arg1 any) error
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) Forget ¶
func (m *MockDispatcher) Forget(arg0 Event)
Forget mocks base method.
func (*MockDispatcher) GetListeners ¶
func (m *MockDispatcher) GetListeners(arg0 Event) []Listener
GetListeners mocks base method.
func (*MockDispatcher) HasListeners ¶
func (m *MockDispatcher) HasListeners(arg0 Event) bool
HasListeners mocks base method.
func (*MockDispatcher) List ¶
func (m *MockDispatcher) List() map[Event][]Listener
List mocks base method.
func (*MockDispatcher) Listen ¶
func (m *MockDispatcher) Listen(arg0 Event, arg1 Listener)
Listen mocks base method.
type MockDispatcherMockRecorder ¶
type MockDispatcherMockRecorder struct {
// contains filtered or unexported fields
}
MockDispatcherMockRecorder is the mock recorder for MockDispatcher.
func (*MockDispatcherMockRecorder) Dispatch ¶
func (mr *MockDispatcherMockRecorder) Dispatch(arg0, arg1 any) *gomock.Call
Dispatch indicates an expected call of Dispatch.
func (*MockDispatcherMockRecorder) Forget ¶
func (mr *MockDispatcherMockRecorder) Forget(arg0 any) *gomock.Call
Forget indicates an expected call of Forget.
func (*MockDispatcherMockRecorder) GetListeners ¶
func (mr *MockDispatcherMockRecorder) GetListeners(arg0 any) *gomock.Call
GetListeners indicates an expected call of GetListeners.
func (*MockDispatcherMockRecorder) HasListeners ¶
func (mr *MockDispatcherMockRecorder) HasListeners(arg0 any) *gomock.Call
HasListeners indicates an expected call of HasListeners.
func (*MockDispatcherMockRecorder) List ¶
func (mr *MockDispatcherMockRecorder) List() *gomock.Call
List indicates an expected call of List.
func (*MockDispatcherMockRecorder) Listen ¶
func (mr *MockDispatcherMockRecorder) Listen(arg0, arg1 any) *gomock.Call
Listen indicates an expected call of Listen.