github.com/metacubex/quic-go@v0.44.1-0.20240520163451-20b689a59136/mock_raw_conn_test.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: github.com/metacubex/quic-go (interfaces: RawConn) 3 // 4 // Generated by this command: 5 // 6 // mockgen -typed -build_flags=-tags=gomock -package quic -self_package github.com/metacubex/quic-go -destination mock_raw_conn_test.go github.com/metacubex/quic-go RawConn 7 // 8 9 // Package quic is a generated GoMock package. 10 package quic 11 12 import ( 13 net "net" 14 reflect "reflect" 15 time "time" 16 17 protocol "github.com/metacubex/quic-go/internal/protocol" 18 gomock "go.uber.org/mock/gomock" 19 ) 20 21 // MockRawConn is a mock of RawConn interface. 22 type MockRawConn struct { 23 ctrl *gomock.Controller 24 recorder *MockRawConnMockRecorder 25 } 26 27 // MockRawConnMockRecorder is the mock recorder for MockRawConn. 28 type MockRawConnMockRecorder struct { 29 mock *MockRawConn 30 } 31 32 // NewMockRawConn creates a new mock instance. 33 func NewMockRawConn(ctrl *gomock.Controller) *MockRawConn { 34 mock := &MockRawConn{ctrl: ctrl} 35 mock.recorder = &MockRawConnMockRecorder{mock} 36 return mock 37 } 38 39 // EXPECT returns an object that allows the caller to indicate expected use. 40 func (m *MockRawConn) EXPECT() *MockRawConnMockRecorder { 41 return m.recorder 42 } 43 44 // Close mocks base method. 45 func (m *MockRawConn) Close() error { 46 m.ctrl.T.Helper() 47 ret := m.ctrl.Call(m, "Close") 48 ret0, _ := ret[0].(error) 49 return ret0 50 } 51 52 // Close indicates an expected call of Close. 53 func (mr *MockRawConnMockRecorder) Close() *MockRawConnCloseCall { 54 mr.mock.ctrl.T.Helper() 55 call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockRawConn)(nil).Close)) 56 return &MockRawConnCloseCall{Call: call} 57 } 58 59 // MockRawConnCloseCall wrap *gomock.Call 60 type MockRawConnCloseCall struct { 61 *gomock.Call 62 } 63 64 // Return rewrite *gomock.Call.Return 65 func (c *MockRawConnCloseCall) Return(arg0 error) *MockRawConnCloseCall { 66 c.Call = c.Call.Return(arg0) 67 return c 68 } 69 70 // Do rewrite *gomock.Call.Do 71 func (c *MockRawConnCloseCall) Do(f func() error) *MockRawConnCloseCall { 72 c.Call = c.Call.Do(f) 73 return c 74 } 75 76 // DoAndReturn rewrite *gomock.Call.DoAndReturn 77 func (c *MockRawConnCloseCall) DoAndReturn(f func() error) *MockRawConnCloseCall { 78 c.Call = c.Call.DoAndReturn(f) 79 return c 80 } 81 82 // LocalAddr mocks base method. 83 func (m *MockRawConn) LocalAddr() net.Addr { 84 m.ctrl.T.Helper() 85 ret := m.ctrl.Call(m, "LocalAddr") 86 ret0, _ := ret[0].(net.Addr) 87 return ret0 88 } 89 90 // LocalAddr indicates an expected call of LocalAddr. 91 func (mr *MockRawConnMockRecorder) LocalAddr() *MockRawConnLocalAddrCall { 92 mr.mock.ctrl.T.Helper() 93 call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalAddr", reflect.TypeOf((*MockRawConn)(nil).LocalAddr)) 94 return &MockRawConnLocalAddrCall{Call: call} 95 } 96 97 // MockRawConnLocalAddrCall wrap *gomock.Call 98 type MockRawConnLocalAddrCall struct { 99 *gomock.Call 100 } 101 102 // Return rewrite *gomock.Call.Return 103 func (c *MockRawConnLocalAddrCall) Return(arg0 net.Addr) *MockRawConnLocalAddrCall { 104 c.Call = c.Call.Return(arg0) 105 return c 106 } 107 108 // Do rewrite *gomock.Call.Do 109 func (c *MockRawConnLocalAddrCall) Do(f func() net.Addr) *MockRawConnLocalAddrCall { 110 c.Call = c.Call.Do(f) 111 return c 112 } 113 114 // DoAndReturn rewrite *gomock.Call.DoAndReturn 115 func (c *MockRawConnLocalAddrCall) DoAndReturn(f func() net.Addr) *MockRawConnLocalAddrCall { 116 c.Call = c.Call.DoAndReturn(f) 117 return c 118 } 119 120 // ReadPacket mocks base method. 121 func (m *MockRawConn) ReadPacket() (receivedPacket, error) { 122 m.ctrl.T.Helper() 123 ret := m.ctrl.Call(m, "ReadPacket") 124 ret0, _ := ret[0].(receivedPacket) 125 ret1, _ := ret[1].(error) 126 return ret0, ret1 127 } 128 129 // ReadPacket indicates an expected call of ReadPacket. 130 func (mr *MockRawConnMockRecorder) ReadPacket() *MockRawConnReadPacketCall { 131 mr.mock.ctrl.T.Helper() 132 call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadPacket", reflect.TypeOf((*MockRawConn)(nil).ReadPacket)) 133 return &MockRawConnReadPacketCall{Call: call} 134 } 135 136 // MockRawConnReadPacketCall wrap *gomock.Call 137 type MockRawConnReadPacketCall struct { 138 *gomock.Call 139 } 140 141 // Return rewrite *gomock.Call.Return 142 func (c *MockRawConnReadPacketCall) Return(arg0 receivedPacket, arg1 error) *MockRawConnReadPacketCall { 143 c.Call = c.Call.Return(arg0, arg1) 144 return c 145 } 146 147 // Do rewrite *gomock.Call.Do 148 func (c *MockRawConnReadPacketCall) Do(f func() (receivedPacket, error)) *MockRawConnReadPacketCall { 149 c.Call = c.Call.Do(f) 150 return c 151 } 152 153 // DoAndReturn rewrite *gomock.Call.DoAndReturn 154 func (c *MockRawConnReadPacketCall) DoAndReturn(f func() (receivedPacket, error)) *MockRawConnReadPacketCall { 155 c.Call = c.Call.DoAndReturn(f) 156 return c 157 } 158 159 // SetReadDeadline mocks base method. 160 func (m *MockRawConn) SetReadDeadline(arg0 time.Time) error { 161 m.ctrl.T.Helper() 162 ret := m.ctrl.Call(m, "SetReadDeadline", arg0) 163 ret0, _ := ret[0].(error) 164 return ret0 165 } 166 167 // SetReadDeadline indicates an expected call of SetReadDeadline. 168 func (mr *MockRawConnMockRecorder) SetReadDeadline(arg0 any) *MockRawConnSetReadDeadlineCall { 169 mr.mock.ctrl.T.Helper() 170 call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockRawConn)(nil).SetReadDeadline), arg0) 171 return &MockRawConnSetReadDeadlineCall{Call: call} 172 } 173 174 // MockRawConnSetReadDeadlineCall wrap *gomock.Call 175 type MockRawConnSetReadDeadlineCall struct { 176 *gomock.Call 177 } 178 179 // Return rewrite *gomock.Call.Return 180 func (c *MockRawConnSetReadDeadlineCall) Return(arg0 error) *MockRawConnSetReadDeadlineCall { 181 c.Call = c.Call.Return(arg0) 182 return c 183 } 184 185 // Do rewrite *gomock.Call.Do 186 func (c *MockRawConnSetReadDeadlineCall) Do(f func(time.Time) error) *MockRawConnSetReadDeadlineCall { 187 c.Call = c.Call.Do(f) 188 return c 189 } 190 191 // DoAndReturn rewrite *gomock.Call.DoAndReturn 192 func (c *MockRawConnSetReadDeadlineCall) DoAndReturn(f func(time.Time) error) *MockRawConnSetReadDeadlineCall { 193 c.Call = c.Call.DoAndReturn(f) 194 return c 195 } 196 197 // WritePacket mocks base method. 198 func (m *MockRawConn) WritePacket(arg0 []byte, arg1 net.Addr, arg2 []byte, arg3 uint16, arg4 protocol.ECN) (int, error) { 199 m.ctrl.T.Helper() 200 ret := m.ctrl.Call(m, "WritePacket", arg0, arg1, arg2, arg3, arg4) 201 ret0, _ := ret[0].(int) 202 ret1, _ := ret[1].(error) 203 return ret0, ret1 204 } 205 206 // WritePacket indicates an expected call of WritePacket. 207 func (mr *MockRawConnMockRecorder) WritePacket(arg0, arg1, arg2, arg3, arg4 any) *MockRawConnWritePacketCall { 208 mr.mock.ctrl.T.Helper() 209 call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WritePacket", reflect.TypeOf((*MockRawConn)(nil).WritePacket), arg0, arg1, arg2, arg3, arg4) 210 return &MockRawConnWritePacketCall{Call: call} 211 } 212 213 // MockRawConnWritePacketCall wrap *gomock.Call 214 type MockRawConnWritePacketCall struct { 215 *gomock.Call 216 } 217 218 // Return rewrite *gomock.Call.Return 219 func (c *MockRawConnWritePacketCall) Return(arg0 int, arg1 error) *MockRawConnWritePacketCall { 220 c.Call = c.Call.Return(arg0, arg1) 221 return c 222 } 223 224 // Do rewrite *gomock.Call.Do 225 func (c *MockRawConnWritePacketCall) Do(f func([]byte, net.Addr, []byte, uint16, protocol.ECN) (int, error)) *MockRawConnWritePacketCall { 226 c.Call = c.Call.Do(f) 227 return c 228 } 229 230 // DoAndReturn rewrite *gomock.Call.DoAndReturn 231 func (c *MockRawConnWritePacketCall) DoAndReturn(f func([]byte, net.Addr, []byte, uint16, protocol.ECN) (int, error)) *MockRawConnWritePacketCall { 232 c.Call = c.Call.DoAndReturn(f) 233 return c 234 } 235 236 // capabilities mocks base method. 237 func (m *MockRawConn) capabilities() connCapabilities { 238 m.ctrl.T.Helper() 239 ret := m.ctrl.Call(m, "capabilities") 240 ret0, _ := ret[0].(connCapabilities) 241 return ret0 242 } 243 244 // capabilities indicates an expected call of capabilities. 245 func (mr *MockRawConnMockRecorder) capabilities() *MockRawConncapabilitiesCall { 246 mr.mock.ctrl.T.Helper() 247 call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "capabilities", reflect.TypeOf((*MockRawConn)(nil).capabilities)) 248 return &MockRawConncapabilitiesCall{Call: call} 249 } 250 251 // MockRawConncapabilitiesCall wrap *gomock.Call 252 type MockRawConncapabilitiesCall struct { 253 *gomock.Call 254 } 255 256 // Return rewrite *gomock.Call.Return 257 func (c *MockRawConncapabilitiesCall) Return(arg0 connCapabilities) *MockRawConncapabilitiesCall { 258 c.Call = c.Call.Return(arg0) 259 return c 260 } 261 262 // Do rewrite *gomock.Call.Do 263 func (c *MockRawConncapabilitiesCall) Do(f func() connCapabilities) *MockRawConncapabilitiesCall { 264 c.Call = c.Call.Do(f) 265 return c 266 } 267 268 // DoAndReturn rewrite *gomock.Call.DoAndReturn 269 func (c *MockRawConncapabilitiesCall) DoAndReturn(f func() connCapabilities) *MockRawConncapabilitiesCall { 270 c.Call = c.Call.DoAndReturn(f) 271 return c 272 }