|
|
@ -11,43 +11,43 @@ import ( |
|
|
|
reflect "reflect" |
|
|
|
reflect "reflect" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// MockPubSub is a mock of PubSub interface
|
|
|
|
// Mockpubsub is a mock of pubsub interface
|
|
|
|
type MockPubSub struct { |
|
|
|
type Mockpubsub struct { |
|
|
|
ctrl *gomock.Controller |
|
|
|
ctrl *gomock.Controller |
|
|
|
recorder *MockPubSubMockRecorder |
|
|
|
recorder *MockpubsubMockRecorder |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MockPubSubMockRecorder is the mock recorder for MockPubSub
|
|
|
|
// MockpubsubMockRecorder is the mock recorder for Mockpubsub
|
|
|
|
type MockPubSubMockRecorder struct { |
|
|
|
type MockpubsubMockRecorder struct { |
|
|
|
mock *MockPubSub |
|
|
|
mock *Mockpubsub |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// NewMockPubSub creates a new mock instance
|
|
|
|
// NewMockpubsub creates a new mock instance
|
|
|
|
func NewMockPubSub(ctrl *gomock.Controller) *MockPubSub { |
|
|
|
func NewMockpubsub(ctrl *gomock.Controller) *Mockpubsub { |
|
|
|
mock := &MockPubSub{ctrl: ctrl} |
|
|
|
mock := &Mockpubsub{ctrl: ctrl} |
|
|
|
mock.recorder = &MockPubSubMockRecorder{mock} |
|
|
|
mock.recorder = &MockpubsubMockRecorder{mock} |
|
|
|
return mock |
|
|
|
return mock |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use
|
|
|
|
func (m *MockPubSub) EXPECT() *MockPubSubMockRecorder { |
|
|
|
func (m *Mockpubsub) EXPECT() *MockpubsubMockRecorder { |
|
|
|
return m.recorder |
|
|
|
return m.recorder |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Publish mocks base method
|
|
|
|
// Publish mocks base method
|
|
|
|
func (m *MockPubSub) Publish(topic string, data []byte) error { |
|
|
|
func (m *Mockpubsub) Publish(topic string, data []byte) error { |
|
|
|
ret := m.ctrl.Call(m, "Publish", topic, data) |
|
|
|
ret := m.ctrl.Call(m, "Publish", topic, data) |
|
|
|
ret0, _ := ret[0].(error) |
|
|
|
ret0, _ := ret[0].(error) |
|
|
|
return ret0 |
|
|
|
return ret0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Publish indicates an expected call of Publish
|
|
|
|
// Publish indicates an expected call of Publish
|
|
|
|
func (mr *MockPubSubMockRecorder) Publish(topic, data interface{}) *gomock.Call { |
|
|
|
func (mr *MockpubsubMockRecorder) Publish(topic, data interface{}) *gomock.Call { |
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*MockPubSub)(nil).Publish), topic, data) |
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*Mockpubsub)(nil).Publish), topic, data) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Subscribe mocks base method
|
|
|
|
// Subscribe mocks base method
|
|
|
|
func (m *MockPubSub) Subscribe(topic string, opts ...go_libp2p_pubsub.SubOpt) (*go_libp2p_pubsub.Subscription, error) { |
|
|
|
func (m *Mockpubsub) Subscribe(topic string, opts ...go_libp2p_pubsub.SubOpt) (*go_libp2p_pubsub.Subscription, error) { |
|
|
|
varargs := []interface{}{topic} |
|
|
|
varargs := []interface{}{topic} |
|
|
|
for _, a := range opts { |
|
|
|
for _, a := range opts { |
|
|
|
varargs = append(varargs, a) |
|
|
|
varargs = append(varargs, a) |
|
|
@ -59,36 +59,36 @@ func (m *MockPubSub) Subscribe(topic string, opts ...go_libp2p_pubsub.SubOpt) (* |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Subscribe indicates an expected call of Subscribe
|
|
|
|
// Subscribe indicates an expected call of Subscribe
|
|
|
|
func (mr *MockPubSubMockRecorder) Subscribe(topic interface{}, opts ...interface{}) *gomock.Call { |
|
|
|
func (mr *MockpubsubMockRecorder) Subscribe(topic interface{}, opts ...interface{}) *gomock.Call { |
|
|
|
varargs := append([]interface{}{topic}, opts...) |
|
|
|
varargs := append([]interface{}{topic}, opts...) |
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockPubSub)(nil).Subscribe), varargs...) |
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*Mockpubsub)(nil).Subscribe), varargs...) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MockSubscription is a mock of Subscription interface
|
|
|
|
// Mocksubscription is a mock of subscription interface
|
|
|
|
type MockSubscription struct { |
|
|
|
type Mocksubscription struct { |
|
|
|
ctrl *gomock.Controller |
|
|
|
ctrl *gomock.Controller |
|
|
|
recorder *MockSubscriptionMockRecorder |
|
|
|
recorder *MocksubscriptionMockRecorder |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MockSubscriptionMockRecorder is the mock recorder for MockSubscription
|
|
|
|
// MocksubscriptionMockRecorder is the mock recorder for Mocksubscription
|
|
|
|
type MockSubscriptionMockRecorder struct { |
|
|
|
type MocksubscriptionMockRecorder struct { |
|
|
|
mock *MockSubscription |
|
|
|
mock *Mocksubscription |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// NewMockSubscription creates a new mock instance
|
|
|
|
// NewMocksubscription creates a new mock instance
|
|
|
|
func NewMockSubscription(ctrl *gomock.Controller) *MockSubscription { |
|
|
|
func NewMocksubscription(ctrl *gomock.Controller) *Mocksubscription { |
|
|
|
mock := &MockSubscription{ctrl: ctrl} |
|
|
|
mock := &Mocksubscription{ctrl: ctrl} |
|
|
|
mock.recorder = &MockSubscriptionMockRecorder{mock} |
|
|
|
mock.recorder = &MocksubscriptionMockRecorder{mock} |
|
|
|
return mock |
|
|
|
return mock |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use
|
|
|
|
func (m *MockSubscription) EXPECT() *MockSubscriptionMockRecorder { |
|
|
|
func (m *Mocksubscription) EXPECT() *MocksubscriptionMockRecorder { |
|
|
|
return m.recorder |
|
|
|
return m.recorder |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Next mocks base method
|
|
|
|
// Next mocks base method
|
|
|
|
func (m *MockSubscription) Next(ctx context.Context) (*go_libp2p_pubsub.Message, error) { |
|
|
|
func (m *Mocksubscription) Next(ctx context.Context) (*go_libp2p_pubsub.Message, error) { |
|
|
|
ret := m.ctrl.Call(m, "Next", ctx) |
|
|
|
ret := m.ctrl.Call(m, "Next", ctx) |
|
|
|
ret0, _ := ret[0].(*go_libp2p_pubsub.Message) |
|
|
|
ret0, _ := ret[0].(*go_libp2p_pubsub.Message) |
|
|
|
ret1, _ := ret[1].(error) |
|
|
|
ret1, _ := ret[1].(error) |
|
|
@ -96,16 +96,16 @@ func (m *MockSubscription) Next(ctx context.Context) (*go_libp2p_pubsub.Message, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Next indicates an expected call of Next
|
|
|
|
// Next indicates an expected call of Next
|
|
|
|
func (mr *MockSubscriptionMockRecorder) Next(ctx interface{}) *gomock.Call { |
|
|
|
func (mr *MocksubscriptionMockRecorder) Next(ctx interface{}) *gomock.Call { |
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Next", reflect.TypeOf((*MockSubscription)(nil).Next), ctx) |
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Next", reflect.TypeOf((*Mocksubscription)(nil).Next), ctx) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Cancel mocks base method
|
|
|
|
// Cancel mocks base method
|
|
|
|
func (m *MockSubscription) Cancel() { |
|
|
|
func (m *Mocksubscription) Cancel() { |
|
|
|
m.ctrl.Call(m, "Cancel") |
|
|
|
m.ctrl.Call(m, "Cancel") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Cancel indicates an expected call of Cancel
|
|
|
|
// Cancel indicates an expected call of Cancel
|
|
|
|
func (mr *MockSubscriptionMockRecorder) Cancel() *gomock.Call { |
|
|
|
func (mr *MocksubscriptionMockRecorder) Cancel() *gomock.Call { |
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancel", reflect.TypeOf((*MockSubscription)(nil).Cancel)) |
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancel", reflect.TypeOf((*Mocksubscription)(nil).Cancel)) |
|
|
|
} |
|
|
|
} |
|
|
|