mirror of
https://github.com/rancher/steve.git
synced 2025-07-01 17:22:13 +00:00
179 lines
5.2 KiB
Go
179 lines
5.2 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: github.com/rancher/steve/pkg/sqlcache/db/transaction (interfaces: Client,Stmt)
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen --build_flags=--mod=mod -package db -destination ./transaction_mocks_test.go github.com/rancher/steve/pkg/sqlcache/db/transaction Client,Stmt
|
|
//
|
|
|
|
// Package db is a generated GoMock package.
|
|
package db
|
|
|
|
import (
|
|
context "context"
|
|
sql "database/sql"
|
|
reflect "reflect"
|
|
|
|
transaction "github.com/rancher/steve/pkg/sqlcache/db/transaction"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockClient is a mock of Client interface.
|
|
type MockClient struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockClientMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockClientMockRecorder is the mock recorder for MockClient.
|
|
type MockClientMockRecorder struct {
|
|
mock *MockClient
|
|
}
|
|
|
|
// NewMockClient creates a new mock instance.
|
|
func NewMockClient(ctrl *gomock.Controller) *MockClient {
|
|
mock := &MockClient{ctrl: ctrl}
|
|
mock.recorder = &MockClientMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockClient) EXPECT() *MockClientMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Exec mocks base method.
|
|
func (m *MockClient) Exec(query string, args ...any) (sql.Result, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{query}
|
|
for _, a := range args {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "Exec", varargs...)
|
|
ret0, _ := ret[0].(sql.Result)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Exec indicates an expected call of Exec.
|
|
func (mr *MockClientMockRecorder) Exec(query any, args ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{query}, args...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockClient)(nil).Exec), varargs...)
|
|
}
|
|
|
|
// Stmt mocks base method.
|
|
func (m *MockClient) Stmt(stmt *sql.Stmt) transaction.Stmt {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Stmt", stmt)
|
|
ret0, _ := ret[0].(transaction.Stmt)
|
|
return ret0
|
|
}
|
|
|
|
// Stmt indicates an expected call of Stmt.
|
|
func (mr *MockClientMockRecorder) Stmt(stmt any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stmt", reflect.TypeOf((*MockClient)(nil).Stmt), stmt)
|
|
}
|
|
|
|
// MockStmt is a mock of Stmt interface.
|
|
type MockStmt struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockStmtMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockStmtMockRecorder is the mock recorder for MockStmt.
|
|
type MockStmtMockRecorder struct {
|
|
mock *MockStmt
|
|
}
|
|
|
|
// NewMockStmt creates a new mock instance.
|
|
func NewMockStmt(ctrl *gomock.Controller) *MockStmt {
|
|
mock := &MockStmt{ctrl: ctrl}
|
|
mock.recorder = &MockStmtMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockStmt) EXPECT() *MockStmtMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Exec mocks base method.
|
|
func (m *MockStmt) Exec(args ...any) (sql.Result, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{}
|
|
for _, a := range args {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "Exec", varargs...)
|
|
ret0, _ := ret[0].(sql.Result)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Exec indicates an expected call of Exec.
|
|
func (mr *MockStmtMockRecorder) Exec(args ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockStmt)(nil).Exec), args...)
|
|
}
|
|
|
|
// Query mocks base method.
|
|
func (m *MockStmt) Query(args ...any) (*sql.Rows, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{}
|
|
for _, a := range args {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "Query", varargs...)
|
|
ret0, _ := ret[0].(*sql.Rows)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Query indicates an expected call of Query.
|
|
func (mr *MockStmtMockRecorder) Query(args ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Query", reflect.TypeOf((*MockStmt)(nil).Query), args...)
|
|
}
|
|
|
|
// QueryContext mocks base method.
|
|
func (m *MockStmt) QueryContext(ctx context.Context, args ...any) (*sql.Rows, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{ctx}
|
|
for _, a := range args {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "QueryContext", varargs...)
|
|
ret0, _ := ret[0].(*sql.Rows)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// QueryContext indicates an expected call of QueryContext.
|
|
func (mr *MockStmtMockRecorder) QueryContext(ctx any, args ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{ctx}, args...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryContext", reflect.TypeOf((*MockStmt)(nil).QueryContext), varargs...)
|
|
}
|
|
|
|
// QueryRowContext mocks base method.
|
|
func (m *MockStmt) QueryRowContext(ctx context.Context, args ...any) *sql.Row {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{ctx}
|
|
for _, a := range args {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "QueryRowContext", varargs...)
|
|
ret0, _ := ret[0].(*sql.Row)
|
|
return ret0
|
|
}
|
|
|
|
// QueryRowContext indicates an expected call of QueryRowContext.
|
|
func (mr *MockStmtMockRecorder) QueryRowContext(ctx any, args ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{ctx}, args...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryRowContext", reflect.TypeOf((*MockStmt)(nil).QueryRowContext), varargs...)
|
|
}
|