-
Notifications
You must be signed in to change notification settings - Fork 18
/
pgx_pool_mock.go
239 lines (206 loc) · 8.04 KB
/
pgx_pool_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
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/driftprogramming/pgxpoolmock (interfaces: PgxPool)
// Package pgxpoolmock is a generated GoMock package.
package pgxpoolmock
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
pgconn "github.com/jackc/pgconn"
pgx "github.com/jackc/pgx/v4"
pgxpool "github.com/jackc/pgx/v4/pgxpool"
)
// MockPgxPool is a mock of PgxPool interface.
type MockPgxPool struct {
ctrl *gomock.Controller
recorder *MockPgxPoolMockRecorder
}
// MockPgxPoolMockRecorder is the mock recorder for MockPgxPool.
type MockPgxPoolMockRecorder struct {
mock *MockPgxPool
}
// NewMockPgxPool creates a new mock instance.
func NewMockPgxPool(ctrl *gomock.Controller) *MockPgxPool {
mock := &MockPgxPool{ctrl: ctrl}
mock.recorder = &MockPgxPoolMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockPgxPool) EXPECT() *MockPgxPoolMockRecorder {
return m.recorder
}
// Acquire mocks base method.
func (m *MockPgxPool) Acquire(arg0 context.Context) (*pgxpool.Conn, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Acquire", arg0)
ret0, _ := ret[0].(*pgxpool.Conn)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Acquire indicates an expected call of Acquire.
func (mr *MockPgxPoolMockRecorder) Acquire(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Acquire", reflect.TypeOf((*MockPgxPool)(nil).Acquire), arg0)
}
// Begin mocks base method.
func (m *MockPgxPool) Begin(arg0 context.Context) (pgx.Tx, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Begin", arg0)
ret0, _ := ret[0].(pgx.Tx)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Begin indicates an expected call of Begin.
func (mr *MockPgxPoolMockRecorder) Begin(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Begin", reflect.TypeOf((*MockPgxPool)(nil).Begin), arg0)
}
// BeginFunc mocks base method.
func (m *MockPgxPool) BeginFunc(arg0 context.Context, arg1 func(pgx.Tx) error) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BeginFunc", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// BeginFunc indicates an expected call of BeginFunc.
func (mr *MockPgxPoolMockRecorder) BeginFunc(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginFunc", reflect.TypeOf((*MockPgxPool)(nil).BeginFunc), arg0, arg1)
}
// BeginTx mocks base method.
func (m *MockPgxPool) BeginTx(arg0 context.Context, arg1 pgx.TxOptions) (pgx.Tx, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BeginTx", arg0, arg1)
ret0, _ := ret[0].(pgx.Tx)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BeginTx indicates an expected call of BeginTx.
func (mr *MockPgxPoolMockRecorder) BeginTx(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginTx", reflect.TypeOf((*MockPgxPool)(nil).BeginTx), arg0, arg1)
}
// BeginTxFunc mocks base method.
func (m *MockPgxPool) BeginTxFunc(arg0 context.Context, arg1 pgx.TxOptions, arg2 func(pgx.Tx) error) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BeginTxFunc", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// BeginTxFunc indicates an expected call of BeginTxFunc.
func (mr *MockPgxPoolMockRecorder) BeginTxFunc(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginTxFunc", reflect.TypeOf((*MockPgxPool)(nil).BeginTxFunc), arg0, arg1, arg2)
}
// Close mocks base method.
func (m *MockPgxPool) Close() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Close")
}
// Close indicates an expected call of Close.
func (mr *MockPgxPoolMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockPgxPool)(nil).Close))
}
// Config mocks base method.
func (m *MockPgxPool) Config() *pgxpool.Config {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Config")
ret0, _ := ret[0].(*pgxpool.Config)
return ret0
}
// Config indicates an expected call of Config.
func (mr *MockPgxPoolMockRecorder) Config() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Config", reflect.TypeOf((*MockPgxPool)(nil).Config))
}
// Exec mocks base method.
func (m *MockPgxPool) Exec(arg0 context.Context, arg1 string, arg2 ...interface{}) (pgconn.CommandTag, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Exec", varargs...)
ret0, _ := ret[0].(pgconn.CommandTag)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Exec indicates an expected call of Exec.
func (mr *MockPgxPoolMockRecorder) Exec(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockPgxPool)(nil).Exec), varargs...)
}
// Query mocks base method.
func (m *MockPgxPool) Query(arg0 context.Context, arg1 string, arg2 ...interface{}) (pgx.Rows, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Query", varargs...)
ret0, _ := ret[0].(pgx.Rows)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Query indicates an expected call of Query.
func (mr *MockPgxPoolMockRecorder) Query(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Query", reflect.TypeOf((*MockPgxPool)(nil).Query), varargs...)
}
// QueryFunc mocks base method.
func (m *MockPgxPool) QueryFunc(arg0 context.Context, arg1 string, arg2, arg3 []interface{}, arg4 func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "QueryFunc", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(pgconn.CommandTag)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// QueryFunc indicates an expected call of QueryFunc.
func (mr *MockPgxPoolMockRecorder) QueryFunc(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryFunc", reflect.TypeOf((*MockPgxPool)(nil).QueryFunc), arg0, arg1, arg2, arg3, arg4)
}
// QueryRow mocks base method.
func (m *MockPgxPool) QueryRow(arg0 context.Context, arg1 string, arg2 ...interface{}) pgx.Row {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "QueryRow", varargs...)
ret0, _ := ret[0].(pgx.Row)
return ret0
}
// QueryRow indicates an expected call of QueryRow.
func (mr *MockPgxPoolMockRecorder) QueryRow(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryRow", reflect.TypeOf((*MockPgxPool)(nil).QueryRow), varargs...)
}
// SendBatch mocks base method.
func (m *MockPgxPool) SendBatch(arg0 context.Context, arg1 *pgx.Batch) pgx.BatchResults {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendBatch", arg0, arg1)
ret0, _ := ret[0].(pgx.BatchResults)
return ret0
}
// SendBatch indicates an expected call of SendBatch.
func (mr *MockPgxPoolMockRecorder) SendBatch(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendBatch", reflect.TypeOf((*MockPgxPool)(nil).SendBatch), arg0, arg1)
}
// Stat mocks base method.
func (m *MockPgxPool) Stat() *pgxpool.Stat {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Stat")
ret0, _ := ret[0].(*pgxpool.Stat)
return ret0
}
// Stat indicates an expected call of Stat.
func (mr *MockPgxPoolMockRecorder) Stat() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stat", reflect.TypeOf((*MockPgxPool)(nil).Stat))
}