github.com/daeuniverse/quic-go@v0.0.0-20240413031024-943f218e0810/mock_packer_test.go (about)

     1  // Code generated by MockGen. DO NOT EDIT.
     2  // Source: github.com/daeuniverse/quic-go (interfaces: Packer)
     3  //
     4  // Generated by this command:
     5  //
     6  //	mockgen -typed -build_flags=-tags=gomock -package quic -self_package github.com/daeuniverse/quic-go -destination mock_packer_test.go github.com/daeuniverse/quic-go Packer
     7  //
     8  
     9  // Package quic is a generated GoMock package.
    10  package quic
    11  
    12  import (
    13  	reflect "reflect"
    14  
    15  	ackhandler "github.com/daeuniverse/quic-go/internal/ackhandler"
    16  	protocol "github.com/daeuniverse/quic-go/internal/protocol"
    17  	qerr "github.com/daeuniverse/quic-go/internal/qerr"
    18  	gomock "go.uber.org/mock/gomock"
    19  )
    20  
    21  // MockPacker is a mock of Packer interface.
    22  type MockPacker struct {
    23  	ctrl     *gomock.Controller
    24  	recorder *MockPackerMockRecorder
    25  }
    26  
    27  // MockPackerMockRecorder is the mock recorder for MockPacker.
    28  type MockPackerMockRecorder struct {
    29  	mock *MockPacker
    30  }
    31  
    32  // NewMockPacker creates a new mock instance.
    33  func NewMockPacker(ctrl *gomock.Controller) *MockPacker {
    34  	mock := &MockPacker{ctrl: ctrl}
    35  	mock.recorder = &MockPackerMockRecorder{mock}
    36  	return mock
    37  }
    38  
    39  // EXPECT returns an object that allows the caller to indicate expected use.
    40  func (m *MockPacker) EXPECT() *MockPackerMockRecorder {
    41  	return m.recorder
    42  }
    43  
    44  // AppendPacket mocks base method.
    45  func (m *MockPacker) AppendPacket(arg0 *packetBuffer, arg1 protocol.ByteCount, arg2 protocol.Version) (shortHeaderPacket, error) {
    46  	m.ctrl.T.Helper()
    47  	ret := m.ctrl.Call(m, "AppendPacket", arg0, arg1, arg2)
    48  	ret0, _ := ret[0].(shortHeaderPacket)
    49  	ret1, _ := ret[1].(error)
    50  	return ret0, ret1
    51  }
    52  
    53  // AppendPacket indicates an expected call of AppendPacket.
    54  func (mr *MockPackerMockRecorder) AppendPacket(arg0, arg1, arg2 any) *MockPackerAppendPacketCall {
    55  	mr.mock.ctrl.T.Helper()
    56  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendPacket", reflect.TypeOf((*MockPacker)(nil).AppendPacket), arg0, arg1, arg2)
    57  	return &MockPackerAppendPacketCall{Call: call}
    58  }
    59  
    60  // MockPackerAppendPacketCall wrap *gomock.Call
    61  type MockPackerAppendPacketCall struct {
    62  	*gomock.Call
    63  }
    64  
    65  // Return rewrite *gomock.Call.Return
    66  func (c *MockPackerAppendPacketCall) Return(arg0 shortHeaderPacket, arg1 error) *MockPackerAppendPacketCall {
    67  	c.Call = c.Call.Return(arg0, arg1)
    68  	return c
    69  }
    70  
    71  // Do rewrite *gomock.Call.Do
    72  func (c *MockPackerAppendPacketCall) Do(f func(*packetBuffer, protocol.ByteCount, protocol.Version) (shortHeaderPacket, error)) *MockPackerAppendPacketCall {
    73  	c.Call = c.Call.Do(f)
    74  	return c
    75  }
    76  
    77  // DoAndReturn rewrite *gomock.Call.DoAndReturn
    78  func (c *MockPackerAppendPacketCall) DoAndReturn(f func(*packetBuffer, protocol.ByteCount, protocol.Version) (shortHeaderPacket, error)) *MockPackerAppendPacketCall {
    79  	c.Call = c.Call.DoAndReturn(f)
    80  	return c
    81  }
    82  
    83  // MaybePackProbePacket mocks base method.
    84  func (m *MockPacker) MaybePackProbePacket(arg0 protocol.EncryptionLevel, arg1 protocol.ByteCount, arg2 protocol.Version) (*coalescedPacket, error) {
    85  	m.ctrl.T.Helper()
    86  	ret := m.ctrl.Call(m, "MaybePackProbePacket", arg0, arg1, arg2)
    87  	ret0, _ := ret[0].(*coalescedPacket)
    88  	ret1, _ := ret[1].(error)
    89  	return ret0, ret1
    90  }
    91  
    92  // MaybePackProbePacket indicates an expected call of MaybePackProbePacket.
    93  func (mr *MockPackerMockRecorder) MaybePackProbePacket(arg0, arg1, arg2 any) *MockPackerMaybePackProbePacketCall {
    94  	mr.mock.ctrl.T.Helper()
    95  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaybePackProbePacket", reflect.TypeOf((*MockPacker)(nil).MaybePackProbePacket), arg0, arg1, arg2)
    96  	return &MockPackerMaybePackProbePacketCall{Call: call}
    97  }
    98  
    99  // MockPackerMaybePackProbePacketCall wrap *gomock.Call
   100  type MockPackerMaybePackProbePacketCall struct {
   101  	*gomock.Call
   102  }
   103  
   104  // Return rewrite *gomock.Call.Return
   105  func (c *MockPackerMaybePackProbePacketCall) Return(arg0 *coalescedPacket, arg1 error) *MockPackerMaybePackProbePacketCall {
   106  	c.Call = c.Call.Return(arg0, arg1)
   107  	return c
   108  }
   109  
   110  // Do rewrite *gomock.Call.Do
   111  func (c *MockPackerMaybePackProbePacketCall) Do(f func(protocol.EncryptionLevel, protocol.ByteCount, protocol.Version) (*coalescedPacket, error)) *MockPackerMaybePackProbePacketCall {
   112  	c.Call = c.Call.Do(f)
   113  	return c
   114  }
   115  
   116  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   117  func (c *MockPackerMaybePackProbePacketCall) DoAndReturn(f func(protocol.EncryptionLevel, protocol.ByteCount, protocol.Version) (*coalescedPacket, error)) *MockPackerMaybePackProbePacketCall {
   118  	c.Call = c.Call.DoAndReturn(f)
   119  	return c
   120  }
   121  
   122  // PackAckOnlyPacket mocks base method.
   123  func (m *MockPacker) PackAckOnlyPacket(arg0 protocol.ByteCount, arg1 protocol.Version) (shortHeaderPacket, *packetBuffer, error) {
   124  	m.ctrl.T.Helper()
   125  	ret := m.ctrl.Call(m, "PackAckOnlyPacket", arg0, arg1)
   126  	ret0, _ := ret[0].(shortHeaderPacket)
   127  	ret1, _ := ret[1].(*packetBuffer)
   128  	ret2, _ := ret[2].(error)
   129  	return ret0, ret1, ret2
   130  }
   131  
   132  // PackAckOnlyPacket indicates an expected call of PackAckOnlyPacket.
   133  func (mr *MockPackerMockRecorder) PackAckOnlyPacket(arg0, arg1 any) *MockPackerPackAckOnlyPacketCall {
   134  	mr.mock.ctrl.T.Helper()
   135  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PackAckOnlyPacket", reflect.TypeOf((*MockPacker)(nil).PackAckOnlyPacket), arg0, arg1)
   136  	return &MockPackerPackAckOnlyPacketCall{Call: call}
   137  }
   138  
   139  // MockPackerPackAckOnlyPacketCall wrap *gomock.Call
   140  type MockPackerPackAckOnlyPacketCall struct {
   141  	*gomock.Call
   142  }
   143  
   144  // Return rewrite *gomock.Call.Return
   145  func (c *MockPackerPackAckOnlyPacketCall) Return(arg0 shortHeaderPacket, arg1 *packetBuffer, arg2 error) *MockPackerPackAckOnlyPacketCall {
   146  	c.Call = c.Call.Return(arg0, arg1, arg2)
   147  	return c
   148  }
   149  
   150  // Do rewrite *gomock.Call.Do
   151  func (c *MockPackerPackAckOnlyPacketCall) Do(f func(protocol.ByteCount, protocol.Version) (shortHeaderPacket, *packetBuffer, error)) *MockPackerPackAckOnlyPacketCall {
   152  	c.Call = c.Call.Do(f)
   153  	return c
   154  }
   155  
   156  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   157  func (c *MockPackerPackAckOnlyPacketCall) DoAndReturn(f func(protocol.ByteCount, protocol.Version) (shortHeaderPacket, *packetBuffer, error)) *MockPackerPackAckOnlyPacketCall {
   158  	c.Call = c.Call.DoAndReturn(f)
   159  	return c
   160  }
   161  
   162  // PackApplicationClose mocks base method.
   163  func (m *MockPacker) PackApplicationClose(arg0 *qerr.ApplicationError, arg1 protocol.ByteCount, arg2 protocol.Version) (*coalescedPacket, error) {
   164  	m.ctrl.T.Helper()
   165  	ret := m.ctrl.Call(m, "PackApplicationClose", arg0, arg1, arg2)
   166  	ret0, _ := ret[0].(*coalescedPacket)
   167  	ret1, _ := ret[1].(error)
   168  	return ret0, ret1
   169  }
   170  
   171  // PackApplicationClose indicates an expected call of PackApplicationClose.
   172  func (mr *MockPackerMockRecorder) PackApplicationClose(arg0, arg1, arg2 any) *MockPackerPackApplicationCloseCall {
   173  	mr.mock.ctrl.T.Helper()
   174  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PackApplicationClose", reflect.TypeOf((*MockPacker)(nil).PackApplicationClose), arg0, arg1, arg2)
   175  	return &MockPackerPackApplicationCloseCall{Call: call}
   176  }
   177  
   178  // MockPackerPackApplicationCloseCall wrap *gomock.Call
   179  type MockPackerPackApplicationCloseCall struct {
   180  	*gomock.Call
   181  }
   182  
   183  // Return rewrite *gomock.Call.Return
   184  func (c *MockPackerPackApplicationCloseCall) Return(arg0 *coalescedPacket, arg1 error) *MockPackerPackApplicationCloseCall {
   185  	c.Call = c.Call.Return(arg0, arg1)
   186  	return c
   187  }
   188  
   189  // Do rewrite *gomock.Call.Do
   190  func (c *MockPackerPackApplicationCloseCall) Do(f func(*qerr.ApplicationError, protocol.ByteCount, protocol.Version) (*coalescedPacket, error)) *MockPackerPackApplicationCloseCall {
   191  	c.Call = c.Call.Do(f)
   192  	return c
   193  }
   194  
   195  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   196  func (c *MockPackerPackApplicationCloseCall) DoAndReturn(f func(*qerr.ApplicationError, protocol.ByteCount, protocol.Version) (*coalescedPacket, error)) *MockPackerPackApplicationCloseCall {
   197  	c.Call = c.Call.DoAndReturn(f)
   198  	return c
   199  }
   200  
   201  // PackCoalescedPacket mocks base method.
   202  func (m *MockPacker) PackCoalescedPacket(arg0 bool, arg1 protocol.ByteCount, arg2 protocol.Version) (*coalescedPacket, error) {
   203  	m.ctrl.T.Helper()
   204  	ret := m.ctrl.Call(m, "PackCoalescedPacket", arg0, arg1, arg2)
   205  	ret0, _ := ret[0].(*coalescedPacket)
   206  	ret1, _ := ret[1].(error)
   207  	return ret0, ret1
   208  }
   209  
   210  // PackCoalescedPacket indicates an expected call of PackCoalescedPacket.
   211  func (mr *MockPackerMockRecorder) PackCoalescedPacket(arg0, arg1, arg2 any) *MockPackerPackCoalescedPacketCall {
   212  	mr.mock.ctrl.T.Helper()
   213  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PackCoalescedPacket", reflect.TypeOf((*MockPacker)(nil).PackCoalescedPacket), arg0, arg1, arg2)
   214  	return &MockPackerPackCoalescedPacketCall{Call: call}
   215  }
   216  
   217  // MockPackerPackCoalescedPacketCall wrap *gomock.Call
   218  type MockPackerPackCoalescedPacketCall struct {
   219  	*gomock.Call
   220  }
   221  
   222  // Return rewrite *gomock.Call.Return
   223  func (c *MockPackerPackCoalescedPacketCall) Return(arg0 *coalescedPacket, arg1 error) *MockPackerPackCoalescedPacketCall {
   224  	c.Call = c.Call.Return(arg0, arg1)
   225  	return c
   226  }
   227  
   228  // Do rewrite *gomock.Call.Do
   229  func (c *MockPackerPackCoalescedPacketCall) Do(f func(bool, protocol.ByteCount, protocol.Version) (*coalescedPacket, error)) *MockPackerPackCoalescedPacketCall {
   230  	c.Call = c.Call.Do(f)
   231  	return c
   232  }
   233  
   234  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   235  func (c *MockPackerPackCoalescedPacketCall) DoAndReturn(f func(bool, protocol.ByteCount, protocol.Version) (*coalescedPacket, error)) *MockPackerPackCoalescedPacketCall {
   236  	c.Call = c.Call.DoAndReturn(f)
   237  	return c
   238  }
   239  
   240  // PackConnectionClose mocks base method.
   241  func (m *MockPacker) PackConnectionClose(arg0 *qerr.TransportError, arg1 protocol.ByteCount, arg2 protocol.Version) (*coalescedPacket, error) {
   242  	m.ctrl.T.Helper()
   243  	ret := m.ctrl.Call(m, "PackConnectionClose", arg0, arg1, arg2)
   244  	ret0, _ := ret[0].(*coalescedPacket)
   245  	ret1, _ := ret[1].(error)
   246  	return ret0, ret1
   247  }
   248  
   249  // PackConnectionClose indicates an expected call of PackConnectionClose.
   250  func (mr *MockPackerMockRecorder) PackConnectionClose(arg0, arg1, arg2 any) *MockPackerPackConnectionCloseCall {
   251  	mr.mock.ctrl.T.Helper()
   252  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PackConnectionClose", reflect.TypeOf((*MockPacker)(nil).PackConnectionClose), arg0, arg1, arg2)
   253  	return &MockPackerPackConnectionCloseCall{Call: call}
   254  }
   255  
   256  // MockPackerPackConnectionCloseCall wrap *gomock.Call
   257  type MockPackerPackConnectionCloseCall struct {
   258  	*gomock.Call
   259  }
   260  
   261  // Return rewrite *gomock.Call.Return
   262  func (c *MockPackerPackConnectionCloseCall) Return(arg0 *coalescedPacket, arg1 error) *MockPackerPackConnectionCloseCall {
   263  	c.Call = c.Call.Return(arg0, arg1)
   264  	return c
   265  }
   266  
   267  // Do rewrite *gomock.Call.Do
   268  func (c *MockPackerPackConnectionCloseCall) Do(f func(*qerr.TransportError, protocol.ByteCount, protocol.Version) (*coalescedPacket, error)) *MockPackerPackConnectionCloseCall {
   269  	c.Call = c.Call.Do(f)
   270  	return c
   271  }
   272  
   273  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   274  func (c *MockPackerPackConnectionCloseCall) DoAndReturn(f func(*qerr.TransportError, protocol.ByteCount, protocol.Version) (*coalescedPacket, error)) *MockPackerPackConnectionCloseCall {
   275  	c.Call = c.Call.DoAndReturn(f)
   276  	return c
   277  }
   278  
   279  // PackMTUProbePacket mocks base method.
   280  func (m *MockPacker) PackMTUProbePacket(arg0 ackhandler.Frame, arg1 protocol.ByteCount, arg2 protocol.Version) (shortHeaderPacket, *packetBuffer, error) {
   281  	m.ctrl.T.Helper()
   282  	ret := m.ctrl.Call(m, "PackMTUProbePacket", arg0, arg1, arg2)
   283  	ret0, _ := ret[0].(shortHeaderPacket)
   284  	ret1, _ := ret[1].(*packetBuffer)
   285  	ret2, _ := ret[2].(error)
   286  	return ret0, ret1, ret2
   287  }
   288  
   289  // PackMTUProbePacket indicates an expected call of PackMTUProbePacket.
   290  func (mr *MockPackerMockRecorder) PackMTUProbePacket(arg0, arg1, arg2 any) *MockPackerPackMTUProbePacketCall {
   291  	mr.mock.ctrl.T.Helper()
   292  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PackMTUProbePacket", reflect.TypeOf((*MockPacker)(nil).PackMTUProbePacket), arg0, arg1, arg2)
   293  	return &MockPackerPackMTUProbePacketCall{Call: call}
   294  }
   295  
   296  // MockPackerPackMTUProbePacketCall wrap *gomock.Call
   297  type MockPackerPackMTUProbePacketCall struct {
   298  	*gomock.Call
   299  }
   300  
   301  // Return rewrite *gomock.Call.Return
   302  func (c *MockPackerPackMTUProbePacketCall) Return(arg0 shortHeaderPacket, arg1 *packetBuffer, arg2 error) *MockPackerPackMTUProbePacketCall {
   303  	c.Call = c.Call.Return(arg0, arg1, arg2)
   304  	return c
   305  }
   306  
   307  // Do rewrite *gomock.Call.Do
   308  func (c *MockPackerPackMTUProbePacketCall) Do(f func(ackhandler.Frame, protocol.ByteCount, protocol.Version) (shortHeaderPacket, *packetBuffer, error)) *MockPackerPackMTUProbePacketCall {
   309  	c.Call = c.Call.Do(f)
   310  	return c
   311  }
   312  
   313  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   314  func (c *MockPackerPackMTUProbePacketCall) DoAndReturn(f func(ackhandler.Frame, protocol.ByteCount, protocol.Version) (shortHeaderPacket, *packetBuffer, error)) *MockPackerPackMTUProbePacketCall {
   315  	c.Call = c.Call.DoAndReturn(f)
   316  	return c
   317  }
   318  
   319  // SetToken mocks base method.
   320  func (m *MockPacker) SetToken(arg0 []byte) {
   321  	m.ctrl.T.Helper()
   322  	m.ctrl.Call(m, "SetToken", arg0)
   323  }
   324  
   325  // SetToken indicates an expected call of SetToken.
   326  func (mr *MockPackerMockRecorder) SetToken(arg0 any) *MockPackerSetTokenCall {
   327  	mr.mock.ctrl.T.Helper()
   328  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetToken", reflect.TypeOf((*MockPacker)(nil).SetToken), arg0)
   329  	return &MockPackerSetTokenCall{Call: call}
   330  }
   331  
   332  // MockPackerSetTokenCall wrap *gomock.Call
   333  type MockPackerSetTokenCall struct {
   334  	*gomock.Call
   335  }
   336  
   337  // Return rewrite *gomock.Call.Return
   338  func (c *MockPackerSetTokenCall) Return() *MockPackerSetTokenCall {
   339  	c.Call = c.Call.Return()
   340  	return c
   341  }
   342  
   343  // Do rewrite *gomock.Call.Do
   344  func (c *MockPackerSetTokenCall) Do(f func([]byte)) *MockPackerSetTokenCall {
   345  	c.Call = c.Call.Do(f)
   346  	return c
   347  }
   348  
   349  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   350  func (c *MockPackerSetTokenCall) DoAndReturn(f func([]byte)) *MockPackerSetTokenCall {
   351  	c.Call = c.Call.DoAndReturn(f)
   352  	return c
   353  }