github.com/yandex/pandora@v0.5.32/lib/netutil/mocks/conn.go (about) 1 // Code generated by mockery v1.0.0 2 package netmock 3 4 import ( 5 "net" 6 "time" 7 8 "github.com/stretchr/testify/mock" 9 ) 10 11 // Conn is an autogenerated mock type for the Conn type 12 type Conn struct { 13 mock.Mock 14 } 15 16 // Close provides a mock function with given fields: 17 func (_m *Conn) Close() error { 18 ret := _m.Called() 19 20 var r0 error 21 if rf, ok := ret.Get(0).(func() error); ok { 22 r0 = rf() 23 } else { 24 r0 = ret.Error(0) 25 } 26 27 return r0 28 } 29 30 // LocalAddr provides a mock function with given fields: 31 func (_m *Conn) LocalAddr() net.Addr { 32 ret := _m.Called() 33 34 var r0 net.Addr 35 if rf, ok := ret.Get(0).(func() net.Addr); ok { 36 r0 = rf() 37 } else { 38 if ret.Get(0) != nil { 39 r0 = ret.Get(0).(net.Addr) 40 } 41 } 42 43 return r0 44 } 45 46 // Read provides a mock function with given fields: b 47 func (_m *Conn) Read(b []byte) (int, error) { 48 ret := _m.Called(b) 49 50 var r0 int 51 if rf, ok := ret.Get(0).(func([]byte) int); ok { 52 r0 = rf(b) 53 } else { 54 r0 = ret.Get(0).(int) 55 } 56 57 var r1 error 58 if rf, ok := ret.Get(1).(func([]byte) error); ok { 59 r1 = rf(b) 60 } else { 61 r1 = ret.Error(1) 62 } 63 64 return r0, r1 65 } 66 67 // RemoteAddr provides a mock function with given fields: 68 func (_m *Conn) RemoteAddr() net.Addr { 69 ret := _m.Called() 70 71 var r0 net.Addr 72 if rf, ok := ret.Get(0).(func() net.Addr); ok { 73 r0 = rf() 74 } else { 75 if ret.Get(0) != nil { 76 r0 = ret.Get(0).(net.Addr) 77 } 78 } 79 80 return r0 81 } 82 83 // SetDeadline provides a mock function with given fields: t 84 func (_m *Conn) SetDeadline(t time.Time) error { 85 ret := _m.Called(t) 86 87 var r0 error 88 if rf, ok := ret.Get(0).(func(time.Time) error); ok { 89 r0 = rf(t) 90 } else { 91 r0 = ret.Error(0) 92 } 93 94 return r0 95 } 96 97 // SetReadDeadline provides a mock function with given fields: t 98 func (_m *Conn) SetReadDeadline(t time.Time) error { 99 ret := _m.Called(t) 100 101 var r0 error 102 if rf, ok := ret.Get(0).(func(time.Time) error); ok { 103 r0 = rf(t) 104 } else { 105 r0 = ret.Error(0) 106 } 107 108 return r0 109 } 110 111 // SetWriteDeadline provides a mock function with given fields: t 112 func (_m *Conn) SetWriteDeadline(t time.Time) error { 113 ret := _m.Called(t) 114 115 var r0 error 116 if rf, ok := ret.Get(0).(func(time.Time) error); ok { 117 r0 = rf(t) 118 } else { 119 r0 = ret.Error(0) 120 } 121 122 return r0 123 } 124 125 // Write provides a mock function with given fields: b 126 func (_m *Conn) Write(b []byte) (int, error) { 127 ret := _m.Called(b) 128 129 var r0 int 130 if rf, ok := ret.Get(0).(func([]byte) int); ok { 131 r0 = rf(b) 132 } else { 133 r0 = ret.Get(0).(int) 134 } 135 136 var r1 error 137 if rf, ok := ret.Get(1).(func([]byte) error); ok { 138 r1 = rf(b) 139 } else { 140 r1 = ret.Error(1) 141 } 142 143 return r0, r1 144 }