mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 12:46:46 +00:00
This patch adds the User Event Service which is meant to replace the current event polling flow. Each user interested in receiving events should register a new subscriber using the `Service.Subscribe` function and then react on the incoming events. The current patch does not hook this up Bridge user as there are no existing consumers, but it does provide extensive testing for the expected behavior.
49 lines
1.6 KiB
Go
49 lines
1.6 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: github.com/ProtonMail/proton-bridge/v3/internal/events (interfaces: EventPublisher)
|
|
|
|
// Package mocks is a generated GoMock package.
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
events "github.com/ProtonMail/proton-bridge/v3/internal/events"
|
|
gomock "github.com/golang/mock/gomock"
|
|
)
|
|
|
|
// MockEventPublisher is a mock of EventPublisher interface.
|
|
type MockEventPublisher struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockEventPublisherMockRecorder
|
|
}
|
|
|
|
// MockEventPublisherMockRecorder is the mock recorder for MockEventPublisher.
|
|
type MockEventPublisherMockRecorder struct {
|
|
mock *MockEventPublisher
|
|
}
|
|
|
|
// NewMockEventPublisher creates a new mock instance.
|
|
func NewMockEventPublisher(ctrl *gomock.Controller) *MockEventPublisher {
|
|
mock := &MockEventPublisher{ctrl: ctrl}
|
|
mock.recorder = &MockEventPublisherMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockEventPublisher) EXPECT() *MockEventPublisherMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// PublishEvent mocks base method.
|
|
func (m *MockEventPublisher) PublishEvent(arg0 context.Context, arg1 events.Event) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "PublishEvent", arg0, arg1)
|
|
}
|
|
|
|
// PublishEvent indicates an expected call of PublishEvent.
|
|
func (mr *MockEventPublisherMockRecorder) PublishEvent(arg0, arg1 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishEvent", reflect.TypeOf((*MockEventPublisher)(nil).PublishEvent), arg0, arg1)
|
|
}
|