hysteria/extras/sniff/mock_Stream.go
2024-06-29 17:42:30 -07:00

492 lines
12 KiB
Go

// Code generated by mockery v2.43.0. DO NOT EDIT.
package sniff
import (
context "context"
qerr "github.com/apernet/quic-go"
mock "github.com/stretchr/testify/mock"
time "time"
)
// mockStream is an autogenerated mock type for the Stream type
type mockStream struct {
mock.Mock
}
type mockStream_Expecter struct {
mock *mock.Mock
}
func (_m *mockStream) EXPECT() *mockStream_Expecter {
return &mockStream_Expecter{mock: &_m.Mock}
}
// CancelRead provides a mock function with given fields: _a0
func (_m *mockStream) CancelRead(_a0 qerr.StreamErrorCode) {
_m.Called(_a0)
}
// mockStream_CancelRead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelRead'
type mockStream_CancelRead_Call struct {
*mock.Call
}
// CancelRead is a helper method to define mock.On call
// - _a0 qerr.StreamErrorCode
func (_e *mockStream_Expecter) CancelRead(_a0 interface{}) *mockStream_CancelRead_Call {
return &mockStream_CancelRead_Call{Call: _e.mock.On("CancelRead", _a0)}
}
func (_c *mockStream_CancelRead_Call) Run(run func(_a0 qerr.StreamErrorCode)) *mockStream_CancelRead_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(qerr.StreamErrorCode))
})
return _c
}
func (_c *mockStream_CancelRead_Call) Return() *mockStream_CancelRead_Call {
_c.Call.Return()
return _c
}
func (_c *mockStream_CancelRead_Call) RunAndReturn(run func(qerr.StreamErrorCode)) *mockStream_CancelRead_Call {
_c.Call.Return(run)
return _c
}
// CancelWrite provides a mock function with given fields: _a0
func (_m *mockStream) CancelWrite(_a0 qerr.StreamErrorCode) {
_m.Called(_a0)
}
// mockStream_CancelWrite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelWrite'
type mockStream_CancelWrite_Call struct {
*mock.Call
}
// CancelWrite is a helper method to define mock.On call
// - _a0 qerr.StreamErrorCode
func (_e *mockStream_Expecter) CancelWrite(_a0 interface{}) *mockStream_CancelWrite_Call {
return &mockStream_CancelWrite_Call{Call: _e.mock.On("CancelWrite", _a0)}
}
func (_c *mockStream_CancelWrite_Call) Run(run func(_a0 qerr.StreamErrorCode)) *mockStream_CancelWrite_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(qerr.StreamErrorCode))
})
return _c
}
func (_c *mockStream_CancelWrite_Call) Return() *mockStream_CancelWrite_Call {
_c.Call.Return()
return _c
}
func (_c *mockStream_CancelWrite_Call) RunAndReturn(run func(qerr.StreamErrorCode)) *mockStream_CancelWrite_Call {
_c.Call.Return(run)
return _c
}
// Close provides a mock function with given fields:
func (_m *mockStream) Close() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Close")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// mockStream_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type mockStream_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
func (_e *mockStream_Expecter) Close() *mockStream_Close_Call {
return &mockStream_Close_Call{Call: _e.mock.On("Close")}
}
func (_c *mockStream_Close_Call) Run(run func()) *mockStream_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *mockStream_Close_Call) Return(_a0 error) *mockStream_Close_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockStream_Close_Call) RunAndReturn(run func() error) *mockStream_Close_Call {
_c.Call.Return(run)
return _c
}
// Context provides a mock function with given fields:
func (_m *mockStream) Context() context.Context {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Context")
}
var r0 context.Context
if rf, ok := ret.Get(0).(func() context.Context); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(context.Context)
}
}
return r0
}
// mockStream_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context'
type mockStream_Context_Call struct {
*mock.Call
}
// Context is a helper method to define mock.On call
func (_e *mockStream_Expecter) Context() *mockStream_Context_Call {
return &mockStream_Context_Call{Call: _e.mock.On("Context")}
}
func (_c *mockStream_Context_Call) Run(run func()) *mockStream_Context_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *mockStream_Context_Call) Return(_a0 context.Context) *mockStream_Context_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockStream_Context_Call) RunAndReturn(run func() context.Context) *mockStream_Context_Call {
_c.Call.Return(run)
return _c
}
// Read provides a mock function with given fields: p
func (_m *mockStream) Read(p []byte) (int, error) {
ret := _m.Called(p)
if len(ret) == 0 {
panic("no return value specified for Read")
}
var r0 int
var r1 error
if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok {
return rf(p)
}
if rf, ok := ret.Get(0).(func([]byte) int); ok {
r0 = rf(p)
} else {
r0 = ret.Get(0).(int)
}
if rf, ok := ret.Get(1).(func([]byte) error); ok {
r1 = rf(p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockStream_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'
type mockStream_Read_Call struct {
*mock.Call
}
// Read is a helper method to define mock.On call
// - p []byte
func (_e *mockStream_Expecter) Read(p interface{}) *mockStream_Read_Call {
return &mockStream_Read_Call{Call: _e.mock.On("Read", p)}
}
func (_c *mockStream_Read_Call) Run(run func(p []byte)) *mockStream_Read_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]byte))
})
return _c
}
func (_c *mockStream_Read_Call) Return(n int, err error) *mockStream_Read_Call {
_c.Call.Return(n, err)
return _c
}
func (_c *mockStream_Read_Call) RunAndReturn(run func([]byte) (int, error)) *mockStream_Read_Call {
_c.Call.Return(run)
return _c
}
// SetDeadline provides a mock function with given fields: t
func (_m *mockStream) SetDeadline(t time.Time) error {
ret := _m.Called(t)
if len(ret) == 0 {
panic("no return value specified for SetDeadline")
}
var r0 error
if rf, ok := ret.Get(0).(func(time.Time) error); ok {
r0 = rf(t)
} else {
r0 = ret.Error(0)
}
return r0
}
// mockStream_SetDeadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDeadline'
type mockStream_SetDeadline_Call struct {
*mock.Call
}
// SetDeadline is a helper method to define mock.On call
// - t time.Time
func (_e *mockStream_Expecter) SetDeadline(t interface{}) *mockStream_SetDeadline_Call {
return &mockStream_SetDeadline_Call{Call: _e.mock.On("SetDeadline", t)}
}
func (_c *mockStream_SetDeadline_Call) Run(run func(t time.Time)) *mockStream_SetDeadline_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(time.Time))
})
return _c
}
func (_c *mockStream_SetDeadline_Call) Return(_a0 error) *mockStream_SetDeadline_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockStream_SetDeadline_Call) RunAndReturn(run func(time.Time) error) *mockStream_SetDeadline_Call {
_c.Call.Return(run)
return _c
}
// SetReadDeadline provides a mock function with given fields: t
func (_m *mockStream) SetReadDeadline(t time.Time) error {
ret := _m.Called(t)
if len(ret) == 0 {
panic("no return value specified for SetReadDeadline")
}
var r0 error
if rf, ok := ret.Get(0).(func(time.Time) error); ok {
r0 = rf(t)
} else {
r0 = ret.Error(0)
}
return r0
}
// mockStream_SetReadDeadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetReadDeadline'
type mockStream_SetReadDeadline_Call struct {
*mock.Call
}
// SetReadDeadline is a helper method to define mock.On call
// - t time.Time
func (_e *mockStream_Expecter) SetReadDeadline(t interface{}) *mockStream_SetReadDeadline_Call {
return &mockStream_SetReadDeadline_Call{Call: _e.mock.On("SetReadDeadline", t)}
}
func (_c *mockStream_SetReadDeadline_Call) Run(run func(t time.Time)) *mockStream_SetReadDeadline_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(time.Time))
})
return _c
}
func (_c *mockStream_SetReadDeadline_Call) Return(_a0 error) *mockStream_SetReadDeadline_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockStream_SetReadDeadline_Call) RunAndReturn(run func(time.Time) error) *mockStream_SetReadDeadline_Call {
_c.Call.Return(run)
return _c
}
// SetWriteDeadline provides a mock function with given fields: t
func (_m *mockStream) SetWriteDeadline(t time.Time) error {
ret := _m.Called(t)
if len(ret) == 0 {
panic("no return value specified for SetWriteDeadline")
}
var r0 error
if rf, ok := ret.Get(0).(func(time.Time) error); ok {
r0 = rf(t)
} else {
r0 = ret.Error(0)
}
return r0
}
// mockStream_SetWriteDeadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetWriteDeadline'
type mockStream_SetWriteDeadline_Call struct {
*mock.Call
}
// SetWriteDeadline is a helper method to define mock.On call
// - t time.Time
func (_e *mockStream_Expecter) SetWriteDeadline(t interface{}) *mockStream_SetWriteDeadline_Call {
return &mockStream_SetWriteDeadline_Call{Call: _e.mock.On("SetWriteDeadline", t)}
}
func (_c *mockStream_SetWriteDeadline_Call) Run(run func(t time.Time)) *mockStream_SetWriteDeadline_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(time.Time))
})
return _c
}
func (_c *mockStream_SetWriteDeadline_Call) Return(_a0 error) *mockStream_SetWriteDeadline_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockStream_SetWriteDeadline_Call) RunAndReturn(run func(time.Time) error) *mockStream_SetWriteDeadline_Call {
_c.Call.Return(run)
return _c
}
// StreamID provides a mock function with given fields:
func (_m *mockStream) StreamID() qerr.StreamID {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for StreamID")
}
var r0 qerr.StreamID
if rf, ok := ret.Get(0).(func() qerr.StreamID); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(qerr.StreamID)
}
return r0
}
// mockStream_StreamID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StreamID'
type mockStream_StreamID_Call struct {
*mock.Call
}
// StreamID is a helper method to define mock.On call
func (_e *mockStream_Expecter) StreamID() *mockStream_StreamID_Call {
return &mockStream_StreamID_Call{Call: _e.mock.On("StreamID")}
}
func (_c *mockStream_StreamID_Call) Run(run func()) *mockStream_StreamID_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *mockStream_StreamID_Call) Return(_a0 qerr.StreamID) *mockStream_StreamID_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockStream_StreamID_Call) RunAndReturn(run func() qerr.StreamID) *mockStream_StreamID_Call {
_c.Call.Return(run)
return _c
}
// Write provides a mock function with given fields: p
func (_m *mockStream) Write(p []byte) (int, error) {
ret := _m.Called(p)
if len(ret) == 0 {
panic("no return value specified for Write")
}
var r0 int
var r1 error
if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok {
return rf(p)
}
if rf, ok := ret.Get(0).(func([]byte) int); ok {
r0 = rf(p)
} else {
r0 = ret.Get(0).(int)
}
if rf, ok := ret.Get(1).(func([]byte) error); ok {
r1 = rf(p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockStream_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'
type mockStream_Write_Call struct {
*mock.Call
}
// Write is a helper method to define mock.On call
// - p []byte
func (_e *mockStream_Expecter) Write(p interface{}) *mockStream_Write_Call {
return &mockStream_Write_Call{Call: _e.mock.On("Write", p)}
}
func (_c *mockStream_Write_Call) Run(run func(p []byte)) *mockStream_Write_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]byte))
})
return _c
}
func (_c *mockStream_Write_Call) Return(n int, err error) *mockStream_Write_Call {
_c.Call.Return(n, err)
return _c
}
func (_c *mockStream_Write_Call) RunAndReturn(run func([]byte) (int, error)) *mockStream_Write_Call {
_c.Call.Return(run)
return _c
}
// newMockStream creates a new instance of mockStream. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func newMockStream(t interface {
mock.TestingT
Cleanup(func())
}) *mockStream {
mock := &mockStream{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}