forked from topfreegames/pitaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
net.go
181 lines (150 loc) · 5.23 KB
/
net.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// Code generated by MockGen. DO NOT EDIT.
// Source: nn.go
// Package mocks is a generated GoMock package.
package mocks
import (
"net"
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
)
// MockAddr is a mock of Addr interface
type MockAddr struct {
ctrl *gomock.Controller
recorder *MockAddrMockRecorder
}
// MockAddrMockRecorder is the mock recorder for MockAddr
type MockAddrMockRecorder struct {
mock *MockAddr
}
// NewMockAddr creates a new mock instance
func NewMockAddr(ctrl *gomock.Controller) *MockAddr {
mock := &MockAddr{ctrl: ctrl}
mock.recorder = &MockAddrMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockAddr) EXPECT() *MockAddrMockRecorder {
return m.recorder
}
// Network mocks base method
func (m *MockAddr) Network() string {
ret := m.ctrl.Call(m, "Network")
ret0, _ := ret[0].(string)
return ret0
}
// Network indicates an expected call of Network
func (mr *MockAddrMockRecorder) Network() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Network", reflect.TypeOf((*MockAddr)(nil).Network))
}
// String mocks base method
func (m *MockAddr) String() string {
ret := m.ctrl.Call(m, "String")
ret0, _ := ret[0].(string)
return ret0
}
// String indicates an expected call of String
func (mr *MockAddrMockRecorder) String() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "String", reflect.TypeOf((*MockAddr)(nil).String))
}
// MockConn is a mock of Conn interface
type MockConn struct {
ctrl *gomock.Controller
recorder *MockConnMockRecorder
}
// MockConnMockRecorder is the mock recorder for MockConn
type MockConnMockRecorder struct {
mock *MockConn
}
// NewMockConn creates a new mock instance
func NewMockConn(ctrl *gomock.Controller) *MockConn {
mock := &MockConn{ctrl: ctrl}
mock.recorder = &MockConnMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockConn) EXPECT() *MockConnMockRecorder {
return m.recorder
}
// Read mocks base method
func (m *MockConn) Read(b []byte) (int, error) {
ret := m.ctrl.Call(m, "Read", b)
ret0, _ := ret[0].(int)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Read indicates an expected call of Read
func (mr *MockConnMockRecorder) Read(b interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockConn)(nil).Read), b)
}
// Write mocks base method
func (m *MockConn) Write(b []byte) (int, error) {
ret := m.ctrl.Call(m, "Write", b)
ret0, _ := ret[0].(int)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Write indicates an expected call of Write
func (mr *MockConnMockRecorder) Write(b interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockConn)(nil).Write), b)
}
// Close mocks base method
func (m *MockConn) Close() error {
ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error)
return ret0
}
// Close indicates an expected call of Close
func (mr *MockConnMockRecorder) Close() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockConn)(nil).Close))
}
// LocalAddr mocks base method
func (m *MockConn) LocalAddr() net.Addr {
ret := m.ctrl.Call(m, "LocalAddr")
ret0, _ := ret[0].(net.Addr)
return ret0
}
// LocalAddr indicates an expected call of LocalAddr
func (mr *MockConnMockRecorder) LocalAddr() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalAddr", reflect.TypeOf((*MockConn)(nil).LocalAddr))
}
// RemoteAddr mocks base method
func (m *MockConn) RemoteAddr() net.Addr {
ret := m.ctrl.Call(m, "RemoteAddr")
ret0, _ := ret[0].(net.Addr)
return ret0
}
// RemoteAddr indicates an expected call of RemoteAddr
func (mr *MockConnMockRecorder) RemoteAddr() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoteAddr", reflect.TypeOf((*MockConn)(nil).RemoteAddr))
}
// SetDeadline mocks base method
func (m *MockConn) SetDeadline(t time.Time) error {
ret := m.ctrl.Call(m, "SetDeadline", t)
ret0, _ := ret[0].(error)
return ret0
}
// SetDeadline indicates an expected call of SetDeadline
func (mr *MockConnMockRecorder) SetDeadline(t interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockConn)(nil).SetDeadline), t)
}
// SetReadDeadline mocks base method
func (m *MockConn) SetReadDeadline(t time.Time) error {
ret := m.ctrl.Call(m, "SetReadDeadline", t)
ret0, _ := ret[0].(error)
return ret0
}
// SetReadDeadline indicates an expected call of SetReadDeadline
func (mr *MockConnMockRecorder) SetReadDeadline(t interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockConn)(nil).SetReadDeadline), t)
}
// SetWriteDeadline mocks base method
func (m *MockConn) SetWriteDeadline(t time.Time) error {
ret := m.ctrl.Call(m, "SetWriteDeadline", t)
ret0, _ := ret[0].(error)
return ret0
}
// SetWriteDeadline indicates an expected call of SetWriteDeadline
func (mr *MockConnMockRecorder) SetWriteDeadline(t interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockConn)(nil).SetWriteDeadline), t)
}