/
pubsub_nats_client.go
148 lines (126 loc) · 4.95 KB
/
pubsub_nats_client.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
// Code generated by MockGen. DO NOT EDIT.
// Source: go.aporeto.io/bahamut (interfaces: NATSClient)
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
gomock "github.com/golang/mock/gomock"
go_nats "github.com/nats-io/go-nats"
reflect "reflect"
)
// MockNATSClient is a mock of NATSClient interface
type MockNATSClient struct {
ctrl *gomock.Controller
recorder *MockNATSClientMockRecorder
}
// MockNATSClientMockRecorder is the mock recorder for MockNATSClient
type MockNATSClientMockRecorder struct {
mock *MockNATSClient
}
// NewMockNATSClient creates a new mock instance
func NewMockNATSClient(ctrl *gomock.Controller) *MockNATSClient {
mock := &MockNATSClient{ctrl: ctrl}
mock.recorder = &MockNATSClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockNATSClient) EXPECT() *MockNATSClientMockRecorder {
return m.recorder
}
// Close mocks base method
func (m *MockNATSClient) Close() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Close")
}
// Close indicates an expected call of Close
func (mr *MockNATSClientMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockNATSClient)(nil).Close))
}
// Flush mocks base method
func (m *MockNATSClient) Flush() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Flush")
ret0, _ := ret[0].(error)
return ret0
}
// Flush indicates an expected call of Flush
func (mr *MockNATSClientMockRecorder) Flush() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Flush", reflect.TypeOf((*MockNATSClient)(nil).Flush))
}
// IsConnected mocks base method
func (m *MockNATSClient) IsConnected() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsConnected")
ret0, _ := ret[0].(bool)
return ret0
}
// IsConnected indicates an expected call of IsConnected
func (mr *MockNATSClientMockRecorder) IsConnected() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsConnected", reflect.TypeOf((*MockNATSClient)(nil).IsConnected))
}
// IsReconnecting mocks base method
func (m *MockNATSClient) IsReconnecting() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsReconnecting")
ret0, _ := ret[0].(bool)
return ret0
}
// IsReconnecting indicates an expected call of IsReconnecting
func (mr *MockNATSClientMockRecorder) IsReconnecting() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsReconnecting", reflect.TypeOf((*MockNATSClient)(nil).IsReconnecting))
}
// Publish mocks base method
func (m *MockNATSClient) Publish(arg0 string, arg1 []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Publish", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// Publish indicates an expected call of Publish
func (mr *MockNATSClientMockRecorder) Publish(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*MockNATSClient)(nil).Publish), arg0, arg1)
}
// QueueSubscribe mocks base method
func (m *MockNATSClient) QueueSubscribe(arg0, arg1 string, arg2 go_nats.MsgHandler) (*go_nats.Subscription, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "QueueSubscribe", arg0, arg1, arg2)
ret0, _ := ret[0].(*go_nats.Subscription)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// QueueSubscribe indicates an expected call of QueueSubscribe
func (mr *MockNATSClientMockRecorder) QueueSubscribe(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueueSubscribe", reflect.TypeOf((*MockNATSClient)(nil).QueueSubscribe), arg0, arg1, arg2)
}
// RequestWithContext mocks base method
func (m *MockNATSClient) RequestWithContext(arg0 context.Context, arg1 string, arg2 []byte) (*go_nats.Msg, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RequestWithContext", arg0, arg1, arg2)
ret0, _ := ret[0].(*go_nats.Msg)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// RequestWithContext indicates an expected call of RequestWithContext
func (mr *MockNATSClientMockRecorder) RequestWithContext(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestWithContext", reflect.TypeOf((*MockNATSClient)(nil).RequestWithContext), arg0, arg1, arg2)
}
// Subscribe mocks base method
func (m *MockNATSClient) Subscribe(arg0 string, arg1 go_nats.MsgHandler) (*go_nats.Subscription, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Subscribe", arg0, arg1)
ret0, _ := ret[0].(*go_nats.Subscription)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Subscribe indicates an expected call of Subscribe
func (mr *MockNATSClientMockRecorder) Subscribe(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockNATSClient)(nil).Subscribe), arg0, arg1)
}