github.com/koko1123/flow-go-1@v0.29.6/network/p2p/mock/topic.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 context "context" 7 8 p2p "github.com/koko1123/flow-go-1/network/p2p" 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // Topic is an autogenerated mock type for the Topic type 13 type Topic struct { 14 mock.Mock 15 } 16 17 // Close provides a mock function with given fields: 18 func (_m *Topic) Close() error { 19 ret := _m.Called() 20 21 var r0 error 22 if rf, ok := ret.Get(0).(func() error); ok { 23 r0 = rf() 24 } else { 25 r0 = ret.Error(0) 26 } 27 28 return r0 29 } 30 31 // Publish provides a mock function with given fields: _a0, _a1 32 func (_m *Topic) Publish(_a0 context.Context, _a1 []byte) error { 33 ret := _m.Called(_a0, _a1) 34 35 var r0 error 36 if rf, ok := ret.Get(0).(func(context.Context, []byte) error); ok { 37 r0 = rf(_a0, _a1) 38 } else { 39 r0 = ret.Error(0) 40 } 41 42 return r0 43 } 44 45 // String provides a mock function with given fields: 46 func (_m *Topic) String() string { 47 ret := _m.Called() 48 49 var r0 string 50 if rf, ok := ret.Get(0).(func() string); ok { 51 r0 = rf() 52 } else { 53 r0 = ret.Get(0).(string) 54 } 55 56 return r0 57 } 58 59 // Subscribe provides a mock function with given fields: 60 func (_m *Topic) Subscribe() (p2p.Subscription, error) { 61 ret := _m.Called() 62 63 var r0 p2p.Subscription 64 if rf, ok := ret.Get(0).(func() p2p.Subscription); ok { 65 r0 = rf() 66 } else { 67 if ret.Get(0) != nil { 68 r0 = ret.Get(0).(p2p.Subscription) 69 } 70 } 71 72 var r1 error 73 if rf, ok := ret.Get(1).(func() error); ok { 74 r1 = rf() 75 } else { 76 r1 = ret.Error(1) 77 } 78 79 return r0, r1 80 } 81 82 type mockConstructorTestingTNewTopic interface { 83 mock.TestingT 84 Cleanup(func()) 85 } 86 87 // NewTopic creates a new instance of Topic. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 88 func NewTopic(t mockConstructorTestingTNewTopic) *Topic { 89 mock := &Topic{} 90 mock.Mock.Test(t) 91 92 t.Cleanup(func() { mock.AssertExpectations(t) }) 93 94 return mock 95 }