github.com/apernet/quic-go@v0.43.1-0.20240515053213-5e9e635fd9f0/mock_packetconn_test.go (about)

     1  // Code generated by MockGen. DO NOT EDIT.
     2  // Source: net (interfaces: PacketConn)
     3  //
     4  // Generated by this command:
     5  //
     6  //	mockgen -typed -package quic -self_package github.com/apernet/quic-go -self_package github.com/apernet/quic-go -destination mock_packetconn_test.go net PacketConn
     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  	gomock "go.uber.org/mock/gomock"
    18  )
    19  
    20  // MockPacketConn is a mock of PacketConn interface.
    21  type MockPacketConn struct {
    22  	ctrl     *gomock.Controller
    23  	recorder *MockPacketConnMockRecorder
    24  }
    25  
    26  // MockPacketConnMockRecorder is the mock recorder for MockPacketConn.
    27  type MockPacketConnMockRecorder struct {
    28  	mock *MockPacketConn
    29  }
    30  
    31  // NewMockPacketConn creates a new mock instance.
    32  func NewMockPacketConn(ctrl *gomock.Controller) *MockPacketConn {
    33  	mock := &MockPacketConn{ctrl: ctrl}
    34  	mock.recorder = &MockPacketConnMockRecorder{mock}
    35  	return mock
    36  }
    37  
    38  // EXPECT returns an object that allows the caller to indicate expected use.
    39  func (m *MockPacketConn) EXPECT() *MockPacketConnMockRecorder {
    40  	return m.recorder
    41  }
    42  
    43  // Close mocks base method.
    44  func (m *MockPacketConn) Close() error {
    45  	m.ctrl.T.Helper()
    46  	ret := m.ctrl.Call(m, "Close")
    47  	ret0, _ := ret[0].(error)
    48  	return ret0
    49  }
    50  
    51  // Close indicates an expected call of Close.
    52  func (mr *MockPacketConnMockRecorder) Close() *MockPacketConnCloseCall {
    53  	mr.mock.ctrl.T.Helper()
    54  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockPacketConn)(nil).Close))
    55  	return &MockPacketConnCloseCall{Call: call}
    56  }
    57  
    58  // MockPacketConnCloseCall wrap *gomock.Call
    59  type MockPacketConnCloseCall struct {
    60  	*gomock.Call
    61  }
    62  
    63  // Return rewrite *gomock.Call.Return
    64  func (c *MockPacketConnCloseCall) Return(arg0 error) *MockPacketConnCloseCall {
    65  	c.Call = c.Call.Return(arg0)
    66  	return c
    67  }
    68  
    69  // Do rewrite *gomock.Call.Do
    70  func (c *MockPacketConnCloseCall) Do(f func() error) *MockPacketConnCloseCall {
    71  	c.Call = c.Call.Do(f)
    72  	return c
    73  }
    74  
    75  // DoAndReturn rewrite *gomock.Call.DoAndReturn
    76  func (c *MockPacketConnCloseCall) DoAndReturn(f func() error) *MockPacketConnCloseCall {
    77  	c.Call = c.Call.DoAndReturn(f)
    78  	return c
    79  }
    80  
    81  // LocalAddr mocks base method.
    82  func (m *MockPacketConn) LocalAddr() net.Addr {
    83  	m.ctrl.T.Helper()
    84  	ret := m.ctrl.Call(m, "LocalAddr")
    85  	ret0, _ := ret[0].(net.Addr)
    86  	return ret0
    87  }
    88  
    89  // LocalAddr indicates an expected call of LocalAddr.
    90  func (mr *MockPacketConnMockRecorder) LocalAddr() *MockPacketConnLocalAddrCall {
    91  	mr.mock.ctrl.T.Helper()
    92  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalAddr", reflect.TypeOf((*MockPacketConn)(nil).LocalAddr))
    93  	return &MockPacketConnLocalAddrCall{Call: call}
    94  }
    95  
    96  // MockPacketConnLocalAddrCall wrap *gomock.Call
    97  type MockPacketConnLocalAddrCall struct {
    98  	*gomock.Call
    99  }
   100  
   101  // Return rewrite *gomock.Call.Return
   102  func (c *MockPacketConnLocalAddrCall) Return(arg0 net.Addr) *MockPacketConnLocalAddrCall {
   103  	c.Call = c.Call.Return(arg0)
   104  	return c
   105  }
   106  
   107  // Do rewrite *gomock.Call.Do
   108  func (c *MockPacketConnLocalAddrCall) Do(f func() net.Addr) *MockPacketConnLocalAddrCall {
   109  	c.Call = c.Call.Do(f)
   110  	return c
   111  }
   112  
   113  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   114  func (c *MockPacketConnLocalAddrCall) DoAndReturn(f func() net.Addr) *MockPacketConnLocalAddrCall {
   115  	c.Call = c.Call.DoAndReturn(f)
   116  	return c
   117  }
   118  
   119  // ReadFrom mocks base method.
   120  func (m *MockPacketConn) ReadFrom(arg0 []byte) (int, net.Addr, error) {
   121  	m.ctrl.T.Helper()
   122  	ret := m.ctrl.Call(m, "ReadFrom", arg0)
   123  	ret0, _ := ret[0].(int)
   124  	ret1, _ := ret[1].(net.Addr)
   125  	ret2, _ := ret[2].(error)
   126  	return ret0, ret1, ret2
   127  }
   128  
   129  // ReadFrom indicates an expected call of ReadFrom.
   130  func (mr *MockPacketConnMockRecorder) ReadFrom(arg0 any) *MockPacketConnReadFromCall {
   131  	mr.mock.ctrl.T.Helper()
   132  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadFrom", reflect.TypeOf((*MockPacketConn)(nil).ReadFrom), arg0)
   133  	return &MockPacketConnReadFromCall{Call: call}
   134  }
   135  
   136  // MockPacketConnReadFromCall wrap *gomock.Call
   137  type MockPacketConnReadFromCall struct {
   138  	*gomock.Call
   139  }
   140  
   141  // Return rewrite *gomock.Call.Return
   142  func (c *MockPacketConnReadFromCall) Return(arg0 int, arg1 net.Addr, arg2 error) *MockPacketConnReadFromCall {
   143  	c.Call = c.Call.Return(arg0, arg1, arg2)
   144  	return c
   145  }
   146  
   147  // Do rewrite *gomock.Call.Do
   148  func (c *MockPacketConnReadFromCall) Do(f func([]byte) (int, net.Addr, error)) *MockPacketConnReadFromCall {
   149  	c.Call = c.Call.Do(f)
   150  	return c
   151  }
   152  
   153  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   154  func (c *MockPacketConnReadFromCall) DoAndReturn(f func([]byte) (int, net.Addr, error)) *MockPacketConnReadFromCall {
   155  	c.Call = c.Call.DoAndReturn(f)
   156  	return c
   157  }
   158  
   159  // SetDeadline mocks base method.
   160  func (m *MockPacketConn) SetDeadline(arg0 time.Time) error {
   161  	m.ctrl.T.Helper()
   162  	ret := m.ctrl.Call(m, "SetDeadline", arg0)
   163  	ret0, _ := ret[0].(error)
   164  	return ret0
   165  }
   166  
   167  // SetDeadline indicates an expected call of SetDeadline.
   168  func (mr *MockPacketConnMockRecorder) SetDeadline(arg0 any) *MockPacketConnSetDeadlineCall {
   169  	mr.mock.ctrl.T.Helper()
   170  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockPacketConn)(nil).SetDeadline), arg0)
   171  	return &MockPacketConnSetDeadlineCall{Call: call}
   172  }
   173  
   174  // MockPacketConnSetDeadlineCall wrap *gomock.Call
   175  type MockPacketConnSetDeadlineCall struct {
   176  	*gomock.Call
   177  }
   178  
   179  // Return rewrite *gomock.Call.Return
   180  func (c *MockPacketConnSetDeadlineCall) Return(arg0 error) *MockPacketConnSetDeadlineCall {
   181  	c.Call = c.Call.Return(arg0)
   182  	return c
   183  }
   184  
   185  // Do rewrite *gomock.Call.Do
   186  func (c *MockPacketConnSetDeadlineCall) Do(f func(time.Time) error) *MockPacketConnSetDeadlineCall {
   187  	c.Call = c.Call.Do(f)
   188  	return c
   189  }
   190  
   191  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   192  func (c *MockPacketConnSetDeadlineCall) DoAndReturn(f func(time.Time) error) *MockPacketConnSetDeadlineCall {
   193  	c.Call = c.Call.DoAndReturn(f)
   194  	return c
   195  }
   196  
   197  // SetReadDeadline mocks base method.
   198  func (m *MockPacketConn) SetReadDeadline(arg0 time.Time) error {
   199  	m.ctrl.T.Helper()
   200  	ret := m.ctrl.Call(m, "SetReadDeadline", arg0)
   201  	ret0, _ := ret[0].(error)
   202  	return ret0
   203  }
   204  
   205  // SetReadDeadline indicates an expected call of SetReadDeadline.
   206  func (mr *MockPacketConnMockRecorder) SetReadDeadline(arg0 any) *MockPacketConnSetReadDeadlineCall {
   207  	mr.mock.ctrl.T.Helper()
   208  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockPacketConn)(nil).SetReadDeadline), arg0)
   209  	return &MockPacketConnSetReadDeadlineCall{Call: call}
   210  }
   211  
   212  // MockPacketConnSetReadDeadlineCall wrap *gomock.Call
   213  type MockPacketConnSetReadDeadlineCall struct {
   214  	*gomock.Call
   215  }
   216  
   217  // Return rewrite *gomock.Call.Return
   218  func (c *MockPacketConnSetReadDeadlineCall) Return(arg0 error) *MockPacketConnSetReadDeadlineCall {
   219  	c.Call = c.Call.Return(arg0)
   220  	return c
   221  }
   222  
   223  // Do rewrite *gomock.Call.Do
   224  func (c *MockPacketConnSetReadDeadlineCall) Do(f func(time.Time) error) *MockPacketConnSetReadDeadlineCall {
   225  	c.Call = c.Call.Do(f)
   226  	return c
   227  }
   228  
   229  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   230  func (c *MockPacketConnSetReadDeadlineCall) DoAndReturn(f func(time.Time) error) *MockPacketConnSetReadDeadlineCall {
   231  	c.Call = c.Call.DoAndReturn(f)
   232  	return c
   233  }
   234  
   235  // SetWriteDeadline mocks base method.
   236  func (m *MockPacketConn) SetWriteDeadline(arg0 time.Time) error {
   237  	m.ctrl.T.Helper()
   238  	ret := m.ctrl.Call(m, "SetWriteDeadline", arg0)
   239  	ret0, _ := ret[0].(error)
   240  	return ret0
   241  }
   242  
   243  // SetWriteDeadline indicates an expected call of SetWriteDeadline.
   244  func (mr *MockPacketConnMockRecorder) SetWriteDeadline(arg0 any) *MockPacketConnSetWriteDeadlineCall {
   245  	mr.mock.ctrl.T.Helper()
   246  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockPacketConn)(nil).SetWriteDeadline), arg0)
   247  	return &MockPacketConnSetWriteDeadlineCall{Call: call}
   248  }
   249  
   250  // MockPacketConnSetWriteDeadlineCall wrap *gomock.Call
   251  type MockPacketConnSetWriteDeadlineCall struct {
   252  	*gomock.Call
   253  }
   254  
   255  // Return rewrite *gomock.Call.Return
   256  func (c *MockPacketConnSetWriteDeadlineCall) Return(arg0 error) *MockPacketConnSetWriteDeadlineCall {
   257  	c.Call = c.Call.Return(arg0)
   258  	return c
   259  }
   260  
   261  // Do rewrite *gomock.Call.Do
   262  func (c *MockPacketConnSetWriteDeadlineCall) Do(f func(time.Time) error) *MockPacketConnSetWriteDeadlineCall {
   263  	c.Call = c.Call.Do(f)
   264  	return c
   265  }
   266  
   267  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   268  func (c *MockPacketConnSetWriteDeadlineCall) DoAndReturn(f func(time.Time) error) *MockPacketConnSetWriteDeadlineCall {
   269  	c.Call = c.Call.DoAndReturn(f)
   270  	return c
   271  }
   272  
   273  // WriteTo mocks base method.
   274  func (m *MockPacketConn) WriteTo(arg0 []byte, arg1 net.Addr) (int, error) {
   275  	m.ctrl.T.Helper()
   276  	ret := m.ctrl.Call(m, "WriteTo", arg0, arg1)
   277  	ret0, _ := ret[0].(int)
   278  	ret1, _ := ret[1].(error)
   279  	return ret0, ret1
   280  }
   281  
   282  // WriteTo indicates an expected call of WriteTo.
   283  func (mr *MockPacketConnMockRecorder) WriteTo(arg0, arg1 any) *MockPacketConnWriteToCall {
   284  	mr.mock.ctrl.T.Helper()
   285  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteTo", reflect.TypeOf((*MockPacketConn)(nil).WriteTo), arg0, arg1)
   286  	return &MockPacketConnWriteToCall{Call: call}
   287  }
   288  
   289  // MockPacketConnWriteToCall wrap *gomock.Call
   290  type MockPacketConnWriteToCall struct {
   291  	*gomock.Call
   292  }
   293  
   294  // Return rewrite *gomock.Call.Return
   295  func (c *MockPacketConnWriteToCall) Return(arg0 int, arg1 error) *MockPacketConnWriteToCall {
   296  	c.Call = c.Call.Return(arg0, arg1)
   297  	return c
   298  }
   299  
   300  // Do rewrite *gomock.Call.Do
   301  func (c *MockPacketConnWriteToCall) Do(f func([]byte, net.Addr) (int, error)) *MockPacketConnWriteToCall {
   302  	c.Call = c.Call.Do(f)
   303  	return c
   304  }
   305  
   306  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   307  func (c *MockPacketConnWriteToCall) DoAndReturn(f func([]byte, net.Addr) (int, error)) *MockPacketConnWriteToCall {
   308  	c.Call = c.Call.DoAndReturn(f)
   309  	return c
   310  }