github.com/quic-go/quic-go@v0.44.0/internal/mocks/quic/stream.go (about)

     1  // Code generated by MockGen. DO NOT EDIT.
     2  // Source: github.com/quic-go/quic-go (interfaces: Stream)
     3  //
     4  // Generated by this command:
     5  //
     6  //	mockgen -typed -build_flags=-tags=gomock -package mockquic -destination quic/stream.go github.com/quic-go/quic-go Stream
     7  //
     8  
     9  // Package mockquic is a generated GoMock package.
    10  package mockquic
    11  
    12  import (
    13  	context "context"
    14  	reflect "reflect"
    15  	time "time"
    16  
    17  	protocol "github.com/quic-go/quic-go/internal/protocol"
    18  	qerr "github.com/quic-go/quic-go/internal/qerr"
    19  	gomock "go.uber.org/mock/gomock"
    20  )
    21  
    22  // MockStream is a mock of Stream interface.
    23  type MockStream struct {
    24  	ctrl     *gomock.Controller
    25  	recorder *MockStreamMockRecorder
    26  }
    27  
    28  // MockStreamMockRecorder is the mock recorder for MockStream.
    29  type MockStreamMockRecorder struct {
    30  	mock *MockStream
    31  }
    32  
    33  // NewMockStream creates a new mock instance.
    34  func NewMockStream(ctrl *gomock.Controller) *MockStream {
    35  	mock := &MockStream{ctrl: ctrl}
    36  	mock.recorder = &MockStreamMockRecorder{mock}
    37  	return mock
    38  }
    39  
    40  // EXPECT returns an object that allows the caller to indicate expected use.
    41  func (m *MockStream) EXPECT() *MockStreamMockRecorder {
    42  	return m.recorder
    43  }
    44  
    45  // CancelRead mocks base method.
    46  func (m *MockStream) CancelRead(arg0 qerr.StreamErrorCode) {
    47  	m.ctrl.T.Helper()
    48  	m.ctrl.Call(m, "CancelRead", arg0)
    49  }
    50  
    51  // CancelRead indicates an expected call of CancelRead.
    52  func (mr *MockStreamMockRecorder) CancelRead(arg0 any) *MockStreamCancelReadCall {
    53  	mr.mock.ctrl.T.Helper()
    54  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelRead", reflect.TypeOf((*MockStream)(nil).CancelRead), arg0)
    55  	return &MockStreamCancelReadCall{Call: call}
    56  }
    57  
    58  // MockStreamCancelReadCall wrap *gomock.Call
    59  type MockStreamCancelReadCall struct {
    60  	*gomock.Call
    61  }
    62  
    63  // Return rewrite *gomock.Call.Return
    64  func (c *MockStreamCancelReadCall) Return() *MockStreamCancelReadCall {
    65  	c.Call = c.Call.Return()
    66  	return c
    67  }
    68  
    69  // Do rewrite *gomock.Call.Do
    70  func (c *MockStreamCancelReadCall) Do(f func(qerr.StreamErrorCode)) *MockStreamCancelReadCall {
    71  	c.Call = c.Call.Do(f)
    72  	return c
    73  }
    74  
    75  // DoAndReturn rewrite *gomock.Call.DoAndReturn
    76  func (c *MockStreamCancelReadCall) DoAndReturn(f func(qerr.StreamErrorCode)) *MockStreamCancelReadCall {
    77  	c.Call = c.Call.DoAndReturn(f)
    78  	return c
    79  }
    80  
    81  // CancelWrite mocks base method.
    82  func (m *MockStream) CancelWrite(arg0 qerr.StreamErrorCode) {
    83  	m.ctrl.T.Helper()
    84  	m.ctrl.Call(m, "CancelWrite", arg0)
    85  }
    86  
    87  // CancelWrite indicates an expected call of CancelWrite.
    88  func (mr *MockStreamMockRecorder) CancelWrite(arg0 any) *MockStreamCancelWriteCall {
    89  	mr.mock.ctrl.T.Helper()
    90  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelWrite", reflect.TypeOf((*MockStream)(nil).CancelWrite), arg0)
    91  	return &MockStreamCancelWriteCall{Call: call}
    92  }
    93  
    94  // MockStreamCancelWriteCall wrap *gomock.Call
    95  type MockStreamCancelWriteCall struct {
    96  	*gomock.Call
    97  }
    98  
    99  // Return rewrite *gomock.Call.Return
   100  func (c *MockStreamCancelWriteCall) Return() *MockStreamCancelWriteCall {
   101  	c.Call = c.Call.Return()
   102  	return c
   103  }
   104  
   105  // Do rewrite *gomock.Call.Do
   106  func (c *MockStreamCancelWriteCall) Do(f func(qerr.StreamErrorCode)) *MockStreamCancelWriteCall {
   107  	c.Call = c.Call.Do(f)
   108  	return c
   109  }
   110  
   111  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   112  func (c *MockStreamCancelWriteCall) DoAndReturn(f func(qerr.StreamErrorCode)) *MockStreamCancelWriteCall {
   113  	c.Call = c.Call.DoAndReturn(f)
   114  	return c
   115  }
   116  
   117  // Close mocks base method.
   118  func (m *MockStream) Close() error {
   119  	m.ctrl.T.Helper()
   120  	ret := m.ctrl.Call(m, "Close")
   121  	ret0, _ := ret[0].(error)
   122  	return ret0
   123  }
   124  
   125  // Close indicates an expected call of Close.
   126  func (mr *MockStreamMockRecorder) Close() *MockStreamCloseCall {
   127  	mr.mock.ctrl.T.Helper()
   128  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockStream)(nil).Close))
   129  	return &MockStreamCloseCall{Call: call}
   130  }
   131  
   132  // MockStreamCloseCall wrap *gomock.Call
   133  type MockStreamCloseCall struct {
   134  	*gomock.Call
   135  }
   136  
   137  // Return rewrite *gomock.Call.Return
   138  func (c *MockStreamCloseCall) Return(arg0 error) *MockStreamCloseCall {
   139  	c.Call = c.Call.Return(arg0)
   140  	return c
   141  }
   142  
   143  // Do rewrite *gomock.Call.Do
   144  func (c *MockStreamCloseCall) Do(f func() error) *MockStreamCloseCall {
   145  	c.Call = c.Call.Do(f)
   146  	return c
   147  }
   148  
   149  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   150  func (c *MockStreamCloseCall) DoAndReturn(f func() error) *MockStreamCloseCall {
   151  	c.Call = c.Call.DoAndReturn(f)
   152  	return c
   153  }
   154  
   155  // Context mocks base method.
   156  func (m *MockStream) Context() context.Context {
   157  	m.ctrl.T.Helper()
   158  	ret := m.ctrl.Call(m, "Context")
   159  	ret0, _ := ret[0].(context.Context)
   160  	return ret0
   161  }
   162  
   163  // Context indicates an expected call of Context.
   164  func (mr *MockStreamMockRecorder) Context() *MockStreamContextCall {
   165  	mr.mock.ctrl.T.Helper()
   166  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockStream)(nil).Context))
   167  	return &MockStreamContextCall{Call: call}
   168  }
   169  
   170  // MockStreamContextCall wrap *gomock.Call
   171  type MockStreamContextCall struct {
   172  	*gomock.Call
   173  }
   174  
   175  // Return rewrite *gomock.Call.Return
   176  func (c *MockStreamContextCall) Return(arg0 context.Context) *MockStreamContextCall {
   177  	c.Call = c.Call.Return(arg0)
   178  	return c
   179  }
   180  
   181  // Do rewrite *gomock.Call.Do
   182  func (c *MockStreamContextCall) Do(f func() context.Context) *MockStreamContextCall {
   183  	c.Call = c.Call.Do(f)
   184  	return c
   185  }
   186  
   187  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   188  func (c *MockStreamContextCall) DoAndReturn(f func() context.Context) *MockStreamContextCall {
   189  	c.Call = c.Call.DoAndReturn(f)
   190  	return c
   191  }
   192  
   193  // Read mocks base method.
   194  func (m *MockStream) Read(arg0 []byte) (int, error) {
   195  	m.ctrl.T.Helper()
   196  	ret := m.ctrl.Call(m, "Read", arg0)
   197  	ret0, _ := ret[0].(int)
   198  	ret1, _ := ret[1].(error)
   199  	return ret0, ret1
   200  }
   201  
   202  // Read indicates an expected call of Read.
   203  func (mr *MockStreamMockRecorder) Read(arg0 any) *MockStreamReadCall {
   204  	mr.mock.ctrl.T.Helper()
   205  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockStream)(nil).Read), arg0)
   206  	return &MockStreamReadCall{Call: call}
   207  }
   208  
   209  // MockStreamReadCall wrap *gomock.Call
   210  type MockStreamReadCall struct {
   211  	*gomock.Call
   212  }
   213  
   214  // Return rewrite *gomock.Call.Return
   215  func (c *MockStreamReadCall) Return(arg0 int, arg1 error) *MockStreamReadCall {
   216  	c.Call = c.Call.Return(arg0, arg1)
   217  	return c
   218  }
   219  
   220  // Do rewrite *gomock.Call.Do
   221  func (c *MockStreamReadCall) Do(f func([]byte) (int, error)) *MockStreamReadCall {
   222  	c.Call = c.Call.Do(f)
   223  	return c
   224  }
   225  
   226  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   227  func (c *MockStreamReadCall) DoAndReturn(f func([]byte) (int, error)) *MockStreamReadCall {
   228  	c.Call = c.Call.DoAndReturn(f)
   229  	return c
   230  }
   231  
   232  // SetDeadline mocks base method.
   233  func (m *MockStream) SetDeadline(arg0 time.Time) error {
   234  	m.ctrl.T.Helper()
   235  	ret := m.ctrl.Call(m, "SetDeadline", arg0)
   236  	ret0, _ := ret[0].(error)
   237  	return ret0
   238  }
   239  
   240  // SetDeadline indicates an expected call of SetDeadline.
   241  func (mr *MockStreamMockRecorder) SetDeadline(arg0 any) *MockStreamSetDeadlineCall {
   242  	mr.mock.ctrl.T.Helper()
   243  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockStream)(nil).SetDeadline), arg0)
   244  	return &MockStreamSetDeadlineCall{Call: call}
   245  }
   246  
   247  // MockStreamSetDeadlineCall wrap *gomock.Call
   248  type MockStreamSetDeadlineCall struct {
   249  	*gomock.Call
   250  }
   251  
   252  // Return rewrite *gomock.Call.Return
   253  func (c *MockStreamSetDeadlineCall) Return(arg0 error) *MockStreamSetDeadlineCall {
   254  	c.Call = c.Call.Return(arg0)
   255  	return c
   256  }
   257  
   258  // Do rewrite *gomock.Call.Do
   259  func (c *MockStreamSetDeadlineCall) Do(f func(time.Time) error) *MockStreamSetDeadlineCall {
   260  	c.Call = c.Call.Do(f)
   261  	return c
   262  }
   263  
   264  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   265  func (c *MockStreamSetDeadlineCall) DoAndReturn(f func(time.Time) error) *MockStreamSetDeadlineCall {
   266  	c.Call = c.Call.DoAndReturn(f)
   267  	return c
   268  }
   269  
   270  // SetReadDeadline mocks base method.
   271  func (m *MockStream) SetReadDeadline(arg0 time.Time) error {
   272  	m.ctrl.T.Helper()
   273  	ret := m.ctrl.Call(m, "SetReadDeadline", arg0)
   274  	ret0, _ := ret[0].(error)
   275  	return ret0
   276  }
   277  
   278  // SetReadDeadline indicates an expected call of SetReadDeadline.
   279  func (mr *MockStreamMockRecorder) SetReadDeadline(arg0 any) *MockStreamSetReadDeadlineCall {
   280  	mr.mock.ctrl.T.Helper()
   281  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockStream)(nil).SetReadDeadline), arg0)
   282  	return &MockStreamSetReadDeadlineCall{Call: call}
   283  }
   284  
   285  // MockStreamSetReadDeadlineCall wrap *gomock.Call
   286  type MockStreamSetReadDeadlineCall struct {
   287  	*gomock.Call
   288  }
   289  
   290  // Return rewrite *gomock.Call.Return
   291  func (c *MockStreamSetReadDeadlineCall) Return(arg0 error) *MockStreamSetReadDeadlineCall {
   292  	c.Call = c.Call.Return(arg0)
   293  	return c
   294  }
   295  
   296  // Do rewrite *gomock.Call.Do
   297  func (c *MockStreamSetReadDeadlineCall) Do(f func(time.Time) error) *MockStreamSetReadDeadlineCall {
   298  	c.Call = c.Call.Do(f)
   299  	return c
   300  }
   301  
   302  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   303  func (c *MockStreamSetReadDeadlineCall) DoAndReturn(f func(time.Time) error) *MockStreamSetReadDeadlineCall {
   304  	c.Call = c.Call.DoAndReturn(f)
   305  	return c
   306  }
   307  
   308  // SetWriteDeadline mocks base method.
   309  func (m *MockStream) SetWriteDeadline(arg0 time.Time) error {
   310  	m.ctrl.T.Helper()
   311  	ret := m.ctrl.Call(m, "SetWriteDeadline", arg0)
   312  	ret0, _ := ret[0].(error)
   313  	return ret0
   314  }
   315  
   316  // SetWriteDeadline indicates an expected call of SetWriteDeadline.
   317  func (mr *MockStreamMockRecorder) SetWriteDeadline(arg0 any) *MockStreamSetWriteDeadlineCall {
   318  	mr.mock.ctrl.T.Helper()
   319  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockStream)(nil).SetWriteDeadline), arg0)
   320  	return &MockStreamSetWriteDeadlineCall{Call: call}
   321  }
   322  
   323  // MockStreamSetWriteDeadlineCall wrap *gomock.Call
   324  type MockStreamSetWriteDeadlineCall struct {
   325  	*gomock.Call
   326  }
   327  
   328  // Return rewrite *gomock.Call.Return
   329  func (c *MockStreamSetWriteDeadlineCall) Return(arg0 error) *MockStreamSetWriteDeadlineCall {
   330  	c.Call = c.Call.Return(arg0)
   331  	return c
   332  }
   333  
   334  // Do rewrite *gomock.Call.Do
   335  func (c *MockStreamSetWriteDeadlineCall) Do(f func(time.Time) error) *MockStreamSetWriteDeadlineCall {
   336  	c.Call = c.Call.Do(f)
   337  	return c
   338  }
   339  
   340  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   341  func (c *MockStreamSetWriteDeadlineCall) DoAndReturn(f func(time.Time) error) *MockStreamSetWriteDeadlineCall {
   342  	c.Call = c.Call.DoAndReturn(f)
   343  	return c
   344  }
   345  
   346  // StreamID mocks base method.
   347  func (m *MockStream) StreamID() protocol.StreamID {
   348  	m.ctrl.T.Helper()
   349  	ret := m.ctrl.Call(m, "StreamID")
   350  	ret0, _ := ret[0].(protocol.StreamID)
   351  	return ret0
   352  }
   353  
   354  // StreamID indicates an expected call of StreamID.
   355  func (mr *MockStreamMockRecorder) StreamID() *MockStreamStreamIDCall {
   356  	mr.mock.ctrl.T.Helper()
   357  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamID", reflect.TypeOf((*MockStream)(nil).StreamID))
   358  	return &MockStreamStreamIDCall{Call: call}
   359  }
   360  
   361  // MockStreamStreamIDCall wrap *gomock.Call
   362  type MockStreamStreamIDCall struct {
   363  	*gomock.Call
   364  }
   365  
   366  // Return rewrite *gomock.Call.Return
   367  func (c *MockStreamStreamIDCall) Return(arg0 protocol.StreamID) *MockStreamStreamIDCall {
   368  	c.Call = c.Call.Return(arg0)
   369  	return c
   370  }
   371  
   372  // Do rewrite *gomock.Call.Do
   373  func (c *MockStreamStreamIDCall) Do(f func() protocol.StreamID) *MockStreamStreamIDCall {
   374  	c.Call = c.Call.Do(f)
   375  	return c
   376  }
   377  
   378  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   379  func (c *MockStreamStreamIDCall) DoAndReturn(f func() protocol.StreamID) *MockStreamStreamIDCall {
   380  	c.Call = c.Call.DoAndReturn(f)
   381  	return c
   382  }
   383  
   384  // Write mocks base method.
   385  func (m *MockStream) Write(arg0 []byte) (int, error) {
   386  	m.ctrl.T.Helper()
   387  	ret := m.ctrl.Call(m, "Write", arg0)
   388  	ret0, _ := ret[0].(int)
   389  	ret1, _ := ret[1].(error)
   390  	return ret0, ret1
   391  }
   392  
   393  // Write indicates an expected call of Write.
   394  func (mr *MockStreamMockRecorder) Write(arg0 any) *MockStreamWriteCall {
   395  	mr.mock.ctrl.T.Helper()
   396  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockStream)(nil).Write), arg0)
   397  	return &MockStreamWriteCall{Call: call}
   398  }
   399  
   400  // MockStreamWriteCall wrap *gomock.Call
   401  type MockStreamWriteCall struct {
   402  	*gomock.Call
   403  }
   404  
   405  // Return rewrite *gomock.Call.Return
   406  func (c *MockStreamWriteCall) Return(arg0 int, arg1 error) *MockStreamWriteCall {
   407  	c.Call = c.Call.Return(arg0, arg1)
   408  	return c
   409  }
   410  
   411  // Do rewrite *gomock.Call.Do
   412  func (c *MockStreamWriteCall) Do(f func([]byte) (int, error)) *MockStreamWriteCall {
   413  	c.Call = c.Call.Do(f)
   414  	return c
   415  }
   416  
   417  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   418  func (c *MockStreamWriteCall) DoAndReturn(f func([]byte) (int, error)) *MockStreamWriteCall {
   419  	c.Call = c.Call.DoAndReturn(f)
   420  	return c
   421  }