-
Notifications
You must be signed in to change notification settings - Fork 473
/
session.go
114 lines (96 loc) · 3.86 KB
/
session.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
// Code generated by MockGen. DO NOT EDIT.
// Source: ./session.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
gomock "github.com/golang/mock/gomock"
protos "github.com/topfreegames/pitaya/protos"
net "net"
reflect "reflect"
)
// MockNetworkEntity is a mock of NetworkEntity interface
type MockNetworkEntity struct {
ctrl *gomock.Controller
recorder *MockNetworkEntityMockRecorder
}
// MockNetworkEntityMockRecorder is the mock recorder for MockNetworkEntity
type MockNetworkEntityMockRecorder struct {
mock *MockNetworkEntity
}
// NewMockNetworkEntity creates a new mock instance
func NewMockNetworkEntity(ctrl *gomock.Controller) *MockNetworkEntity {
mock := &MockNetworkEntity{ctrl: ctrl}
mock.recorder = &MockNetworkEntityMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockNetworkEntity) EXPECT() *MockNetworkEntityMockRecorder {
return m.recorder
}
// Push mocks base method
func (m *MockNetworkEntity) Push(route string, v interface{}) error {
ret := m.ctrl.Call(m, "Push", route, v)
ret0, _ := ret[0].(error)
return ret0
}
// Push indicates an expected call of Push
func (mr *MockNetworkEntityMockRecorder) Push(route, v interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Push", reflect.TypeOf((*MockNetworkEntity)(nil).Push), route, v)
}
// ResponseMID mocks base method
func (m *MockNetworkEntity) ResponseMID(ctx context.Context, mid uint, v interface{}, isError ...bool) error {
varargs := []interface{}{ctx, mid, v}
for _, a := range isError {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ResponseMID", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// ResponseMID indicates an expected call of ResponseMID
func (mr *MockNetworkEntityMockRecorder) ResponseMID(ctx, mid, v interface{}, isError ...interface{}) *gomock.Call {
varargs := append([]interface{}{ctx, mid, v}, isError...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResponseMID", reflect.TypeOf((*MockNetworkEntity)(nil).ResponseMID), varargs...)
}
// Close mocks base method
func (m *MockNetworkEntity) Close() error {
ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error)
return ret0
}
// Close indicates an expected call of Close
func (mr *MockNetworkEntityMockRecorder) Close() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockNetworkEntity)(nil).Close))
}
// Kick mocks base method
func (m *MockNetworkEntity) Kick(ctx context.Context) error {
ret := m.ctrl.Call(m, "Kick", ctx)
ret0, _ := ret[0].(error)
return ret0
}
// Kick indicates an expected call of Kick
func (mr *MockNetworkEntityMockRecorder) Kick(ctx interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Kick", reflect.TypeOf((*MockNetworkEntity)(nil).Kick), ctx)
}
// RemoteAddr mocks base method
func (m *MockNetworkEntity) 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 *MockNetworkEntityMockRecorder) RemoteAddr() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoteAddr", reflect.TypeOf((*MockNetworkEntity)(nil).RemoteAddr))
}
// SendRequest mocks base method
func (m *MockNetworkEntity) SendRequest(ctx context.Context, serverID, route string, v interface{}) (*protos.Response, error) {
ret := m.ctrl.Call(m, "SendRequest", ctx, serverID, route, v)
ret0, _ := ret[0].(*protos.Response)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SendRequest indicates an expected call of SendRequest
func (mr *MockNetworkEntityMockRecorder) SendRequest(ctx, serverID, route, v interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendRequest", reflect.TypeOf((*MockNetworkEntity)(nil).SendRequest), ctx, serverID, route, v)
}