-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathconn_mock.go
50 lines (40 loc) · 1016 Bytes
/
conn_mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package healer
import (
"net"
"time"
)
// MockConn is a mock struct for the Conn type
type MockConn struct {
MockRead func(p []byte) (n int, err error)
MockWrite func(p []byte) (n int, err error)
MockClose func() error
MockLocalAddr func() net.Addr
MockRemoteAddr func() net.Addr
MockSetDeadline func(t time.Time) error
MockSetReadDeadline func(t time.Time) error
MockSetWriteDeadline func(t time.Time) error
}
func (_m *MockConn) Read(p []byte) (n int, err error) {
return len(p), nil
}
func (_m *MockConn) Write(p []byte) (n int, err error) {
return len(p), nil
}
func (_m *MockConn) Close() error {
return nil
}
func (_m *MockConn) LocalAddr() net.Addr {
return nil
}
func (_m *MockConn) RemoteAddr() net.Addr {
return nil
}
func (_m *MockConn) SetDeadline(t time.Time) error {
return nil
}
func (_m *MockConn) SetReadDeadline(t time.Time) error {
return nil
}
func (_m *MockConn) SetWriteDeadline(t time.Time) error {
return nil
}