github.com/lzy4123/fabric@v2.1.1+incompatible/gossip/comm/mocks/mock_stream.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 gossip "github.com/hyperledger/fabric-protos-go/gossip" 9 metadata "google.golang.org/grpc/metadata" 10 11 mock "github.com/stretchr/testify/mock" 12 ) 13 14 // MockStream is an autogenerated mock type for the MockStream type 15 type MockStream struct { 16 mock.Mock 17 } 18 19 // CloseSend provides a mock function with given fields: 20 func (_m *MockStream) CloseSend() error { 21 ret := _m.Called() 22 23 var r0 error 24 if rf, ok := ret.Get(0).(func() error); ok { 25 r0 = rf() 26 } else { 27 r0 = ret.Error(0) 28 } 29 30 return r0 31 } 32 33 // Context provides a mock function with given fields: 34 func (_m *MockStream) Context() context.Context { 35 ret := _m.Called() 36 37 var r0 context.Context 38 if rf, ok := ret.Get(0).(func() context.Context); ok { 39 r0 = rf() 40 } else { 41 if ret.Get(0) != nil { 42 r0 = ret.Get(0).(context.Context) 43 } 44 } 45 46 return r0 47 } 48 49 // Header provides a mock function with given fields: 50 func (_m *MockStream) Header() (metadata.MD, error) { 51 ret := _m.Called() 52 53 var r0 metadata.MD 54 if rf, ok := ret.Get(0).(func() metadata.MD); ok { 55 r0 = rf() 56 } else { 57 if ret.Get(0) != nil { 58 r0 = ret.Get(0).(metadata.MD) 59 } 60 } 61 62 var r1 error 63 if rf, ok := ret.Get(1).(func() error); ok { 64 r1 = rf() 65 } else { 66 r1 = ret.Error(1) 67 } 68 69 return r0, r1 70 } 71 72 // Recv provides a mock function with given fields: 73 func (_m *MockStream) Recv() (*gossip.Envelope, error) { 74 ret := _m.Called() 75 76 var r0 *gossip.Envelope 77 if rf, ok := ret.Get(0).(func() *gossip.Envelope); ok { 78 r0 = rf() 79 } else { 80 if ret.Get(0) != nil { 81 r0 = ret.Get(0).(*gossip.Envelope) 82 } 83 } 84 85 var r1 error 86 if rf, ok := ret.Get(1).(func() error); ok { 87 r1 = rf() 88 } else { 89 r1 = ret.Error(1) 90 } 91 92 return r0, r1 93 } 94 95 // RecvMsg provides a mock function with given fields: m 96 func (_m *MockStream) RecvMsg(m interface{}) error { 97 ret := _m.Called(m) 98 99 var r0 error 100 if rf, ok := ret.Get(0).(func(interface{}) error); ok { 101 r0 = rf(m) 102 } else { 103 r0 = ret.Error(0) 104 } 105 106 return r0 107 } 108 109 // Send provides a mock function with given fields: _a0 110 func (_m *MockStream) Send(_a0 *gossip.Envelope) error { 111 ret := _m.Called(_a0) 112 113 var r0 error 114 if rf, ok := ret.Get(0).(func(*gossip.Envelope) error); ok { 115 r0 = rf(_a0) 116 } else { 117 r0 = ret.Error(0) 118 } 119 120 return r0 121 } 122 123 // SendMsg provides a mock function with given fields: m 124 func (_m *MockStream) SendMsg(m interface{}) error { 125 ret := _m.Called(m) 126 127 var r0 error 128 if rf, ok := ret.Get(0).(func(interface{}) error); ok { 129 r0 = rf(m) 130 } else { 131 r0 = ret.Error(0) 132 } 133 134 return r0 135 } 136 137 // Trailer provides a mock function with given fields: 138 func (_m *MockStream) Trailer() metadata.MD { 139 ret := _m.Called() 140 141 var r0 metadata.MD 142 if rf, ok := ret.Get(0).(func() metadata.MD); ok { 143 r0 = rf() 144 } else { 145 if ret.Get(0) != nil { 146 r0 = ret.Get(0).(metadata.MD) 147 } 148 } 149 150 return r0 151 }