391 lines
14 KiB
Go
391 lines
14 KiB
Go
|
// Code generated by MockGen. DO NOT EDIT.
|
||
|
// Source: git.sch9.ru/new_gate/ms-auth/internal/users (interfaces: PgRepository,Caller,TxCaller,ValkeyRepository)
|
||
|
//
|
||
|
// Generated by this command:
|
||
|
//
|
||
|
// mockgen . PgRepository,Caller,TxCaller,ValkeyRepository
|
||
|
//
|
||
|
|
||
|
// Package mock_users is a generated GoMock package.
|
||
|
package mock_users
|
||
|
|
||
|
import (
|
||
|
context "context"
|
||
|
reflect "reflect"
|
||
|
|
||
|
models "git.sch9.ru/new_gate/ms-auth/internal/models"
|
||
|
users "git.sch9.ru/new_gate/ms-auth/internal/users"
|
||
|
gomock "go.uber.org/mock/gomock"
|
||
|
)
|
||
|
|
||
|
// MockPgRepository is a mock of PgRepository interface.
|
||
|
type MockPgRepository struct {
|
||
|
ctrl *gomock.Controller
|
||
|
recorder *MockPgRepositoryMockRecorder
|
||
|
isgomock struct{}
|
||
|
}
|
||
|
|
||
|
// MockPgRepositoryMockRecorder is the mock recorder for MockPgRepository.
|
||
|
type MockPgRepositoryMockRecorder struct {
|
||
|
mock *MockPgRepository
|
||
|
}
|
||
|
|
||
|
// NewMockPgRepository creates a new mock instance.
|
||
|
func NewMockPgRepository(ctrl *gomock.Controller) *MockPgRepository {
|
||
|
mock := &MockPgRepository{ctrl: ctrl}
|
||
|
mock.recorder = &MockPgRepositoryMockRecorder{mock}
|
||
|
return mock
|
||
|
}
|
||
|
|
||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||
|
func (m *MockPgRepository) EXPECT() *MockPgRepositoryMockRecorder {
|
||
|
return m.recorder
|
||
|
}
|
||
|
|
||
|
// BeginTx mocks base method.
|
||
|
func (m *MockPgRepository) BeginTx(ctx context.Context) (users.TxCaller, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "BeginTx", ctx)
|
||
|
ret0, _ := ret[0].(users.TxCaller)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// BeginTx indicates an expected call of BeginTx.
|
||
|
func (mr *MockPgRepositoryMockRecorder) BeginTx(ctx any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginTx", reflect.TypeOf((*MockPgRepository)(nil).BeginTx), ctx)
|
||
|
}
|
||
|
|
||
|
// C mocks base method.
|
||
|
func (m *MockPgRepository) C() users.Caller {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "C")
|
||
|
ret0, _ := ret[0].(users.Caller)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// C indicates an expected call of C.
|
||
|
func (mr *MockPgRepositoryMockRecorder) C() *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "C", reflect.TypeOf((*MockPgRepository)(nil).C))
|
||
|
}
|
||
|
|
||
|
// MockCaller is a mock of Caller interface.
|
||
|
type MockCaller struct {
|
||
|
ctrl *gomock.Controller
|
||
|
recorder *MockCallerMockRecorder
|
||
|
isgomock struct{}
|
||
|
}
|
||
|
|
||
|
// MockCallerMockRecorder is the mock recorder for MockCaller.
|
||
|
type MockCallerMockRecorder struct {
|
||
|
mock *MockCaller
|
||
|
}
|
||
|
|
||
|
// NewMockCaller creates a new mock instance.
|
||
|
func NewMockCaller(ctrl *gomock.Controller) *MockCaller {
|
||
|
mock := &MockCaller{ctrl: ctrl}
|
||
|
mock.recorder = &MockCallerMockRecorder{mock}
|
||
|
return mock
|
||
|
}
|
||
|
|
||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||
|
func (m *MockCaller) EXPECT() *MockCallerMockRecorder {
|
||
|
return m.recorder
|
||
|
}
|
||
|
|
||
|
// CreateUser mocks base method.
|
||
|
func (m *MockCaller) CreateUser(ctx context.Context, username, password string, role models.Role) (int32, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "CreateUser", ctx, username, password, role)
|
||
|
ret0, _ := ret[0].(int32)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// CreateUser indicates an expected call of CreateUser.
|
||
|
func (mr *MockCallerMockRecorder) CreateUser(ctx, username, password, role any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockCaller)(nil).CreateUser), ctx, username, password, role)
|
||
|
}
|
||
|
|
||
|
// DeleteUser mocks base method.
|
||
|
func (m *MockCaller) DeleteUser(ctx context.Context, id int32) error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "DeleteUser", ctx, id)
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// DeleteUser indicates an expected call of DeleteUser.
|
||
|
func (mr *MockCallerMockRecorder) DeleteUser(ctx, id any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUser", reflect.TypeOf((*MockCaller)(nil).DeleteUser), ctx, id)
|
||
|
}
|
||
|
|
||
|
// ReadUserById mocks base method.
|
||
|
func (m *MockCaller) ReadUserById(ctx context.Context, id int32) (*models.User, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "ReadUserById", ctx, id)
|
||
|
ret0, _ := ret[0].(*models.User)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// ReadUserById indicates an expected call of ReadUserById.
|
||
|
func (mr *MockCallerMockRecorder) ReadUserById(ctx, id any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadUserById", reflect.TypeOf((*MockCaller)(nil).ReadUserById), ctx, id)
|
||
|
}
|
||
|
|
||
|
// ReadUserByUsername mocks base method.
|
||
|
func (m *MockCaller) ReadUserByUsername(ctx context.Context, username string) (*models.User, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "ReadUserByUsername", ctx, username)
|
||
|
ret0, _ := ret[0].(*models.User)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// ReadUserByUsername indicates an expected call of ReadUserByUsername.
|
||
|
func (mr *MockCallerMockRecorder) ReadUserByUsername(ctx, username any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadUserByUsername", reflect.TypeOf((*MockCaller)(nil).ReadUserByUsername), ctx, username)
|
||
|
}
|
||
|
|
||
|
// UpdateUser mocks base method.
|
||
|
func (m *MockCaller) UpdateUser(ctx context.Context, id int32, username *string, role *models.Role) error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "UpdateUser", ctx, id, username, role)
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// UpdateUser indicates an expected call of UpdateUser.
|
||
|
func (mr *MockCallerMockRecorder) UpdateUser(ctx, id, username, role any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUser", reflect.TypeOf((*MockCaller)(nil).UpdateUser), ctx, id, username, role)
|
||
|
}
|
||
|
|
||
|
// MockTxCaller is a mock of TxCaller interface.
|
||
|
type MockTxCaller struct {
|
||
|
ctrl *gomock.Controller
|
||
|
recorder *MockTxCallerMockRecorder
|
||
|
isgomock struct{}
|
||
|
}
|
||
|
|
||
|
// MockTxCallerMockRecorder is the mock recorder for MockTxCaller.
|
||
|
type MockTxCallerMockRecorder struct {
|
||
|
mock *MockTxCaller
|
||
|
}
|
||
|
|
||
|
// NewMockTxCaller creates a new mock instance.
|
||
|
func NewMockTxCaller(ctrl *gomock.Controller) *MockTxCaller {
|
||
|
mock := &MockTxCaller{ctrl: ctrl}
|
||
|
mock.recorder = &MockTxCallerMockRecorder{mock}
|
||
|
return mock
|
||
|
}
|
||
|
|
||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||
|
func (m *MockTxCaller) EXPECT() *MockTxCallerMockRecorder {
|
||
|
return m.recorder
|
||
|
}
|
||
|
|
||
|
// Commit mocks base method.
|
||
|
func (m *MockTxCaller) Commit() error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "Commit")
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// Commit indicates an expected call of Commit.
|
||
|
func (mr *MockTxCallerMockRecorder) Commit() *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockTxCaller)(nil).Commit))
|
||
|
}
|
||
|
|
||
|
// CreateUser mocks base method.
|
||
|
func (m *MockTxCaller) CreateUser(ctx context.Context, username, password string, role models.Role) (int32, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "CreateUser", ctx, username, password, role)
|
||
|
ret0, _ := ret[0].(int32)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// CreateUser indicates an expected call of CreateUser.
|
||
|
func (mr *MockTxCallerMockRecorder) CreateUser(ctx, username, password, role any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockTxCaller)(nil).CreateUser), ctx, username, password, role)
|
||
|
}
|
||
|
|
||
|
// DeleteUser mocks base method.
|
||
|
func (m *MockTxCaller) DeleteUser(ctx context.Context, id int32) error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "DeleteUser", ctx, id)
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// DeleteUser indicates an expected call of DeleteUser.
|
||
|
func (mr *MockTxCallerMockRecorder) DeleteUser(ctx, id any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUser", reflect.TypeOf((*MockTxCaller)(nil).DeleteUser), ctx, id)
|
||
|
}
|
||
|
|
||
|
// ReadUserById mocks base method.
|
||
|
func (m *MockTxCaller) ReadUserById(ctx context.Context, id int32) (*models.User, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "ReadUserById", ctx, id)
|
||
|
ret0, _ := ret[0].(*models.User)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// ReadUserById indicates an expected call of ReadUserById.
|
||
|
func (mr *MockTxCallerMockRecorder) ReadUserById(ctx, id any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadUserById", reflect.TypeOf((*MockTxCaller)(nil).ReadUserById), ctx, id)
|
||
|
}
|
||
|
|
||
|
// ReadUserByUsername mocks base method.
|
||
|
func (m *MockTxCaller) ReadUserByUsername(ctx context.Context, username string) (*models.User, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "ReadUserByUsername", ctx, username)
|
||
|
ret0, _ := ret[0].(*models.User)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// ReadUserByUsername indicates an expected call of ReadUserByUsername.
|
||
|
func (mr *MockTxCallerMockRecorder) ReadUserByUsername(ctx, username any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadUserByUsername", reflect.TypeOf((*MockTxCaller)(nil).ReadUserByUsername), ctx, username)
|
||
|
}
|
||
|
|
||
|
// Rollback mocks base method.
|
||
|
func (m *MockTxCaller) Rollback() error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "Rollback")
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// Rollback indicates an expected call of Rollback.
|
||
|
func (mr *MockTxCallerMockRecorder) Rollback() *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Rollback", reflect.TypeOf((*MockTxCaller)(nil).Rollback))
|
||
|
}
|
||
|
|
||
|
// UpdateUser mocks base method.
|
||
|
func (m *MockTxCaller) UpdateUser(ctx context.Context, id int32, username *string, role *models.Role) error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "UpdateUser", ctx, id, username, role)
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// UpdateUser indicates an expected call of UpdateUser.
|
||
|
func (mr *MockTxCallerMockRecorder) UpdateUser(ctx, id, username, role any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUser", reflect.TypeOf((*MockTxCaller)(nil).UpdateUser), ctx, id, username, role)
|
||
|
}
|
||
|
|
||
|
// MockValkeyRepository is a mock of ValkeyRepository interface.
|
||
|
type MockValkeyRepository struct {
|
||
|
ctrl *gomock.Controller
|
||
|
recorder *MockValkeyRepositoryMockRecorder
|
||
|
isgomock struct{}
|
||
|
}
|
||
|
|
||
|
// MockValkeyRepositoryMockRecorder is the mock recorder for MockValkeyRepository.
|
||
|
type MockValkeyRepositoryMockRecorder struct {
|
||
|
mock *MockValkeyRepository
|
||
|
}
|
||
|
|
||
|
// NewMockValkeyRepository creates a new mock instance.
|
||
|
func NewMockValkeyRepository(ctrl *gomock.Controller) *MockValkeyRepository {
|
||
|
mock := &MockValkeyRepository{ctrl: ctrl}
|
||
|
mock.recorder = &MockValkeyRepositoryMockRecorder{mock}
|
||
|
return mock
|
||
|
}
|
||
|
|
||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||
|
func (m *MockValkeyRepository) EXPECT() *MockValkeyRepositoryMockRecorder {
|
||
|
return m.recorder
|
||
|
}
|
||
|
|
||
|
// CreateSession mocks base method.
|
||
|
func (m *MockValkeyRepository) CreateSession(ctx context.Context, userId int32, role models.Role) (string, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "CreateSession", ctx, userId, role)
|
||
|
ret0, _ := ret[0].(string)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// CreateSession indicates an expected call of CreateSession.
|
||
|
func (mr *MockValkeyRepositoryMockRecorder) CreateSession(ctx, userId, role any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSession", reflect.TypeOf((*MockValkeyRepository)(nil).CreateSession), ctx, userId, role)
|
||
|
}
|
||
|
|
||
|
// DeleteAllSessions mocks base method.
|
||
|
func (m *MockValkeyRepository) DeleteAllSessions(ctx context.Context, userId int32) error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "DeleteAllSessions", ctx, userId)
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// DeleteAllSessions indicates an expected call of DeleteAllSessions.
|
||
|
func (mr *MockValkeyRepositoryMockRecorder) DeleteAllSessions(ctx, userId any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllSessions", reflect.TypeOf((*MockValkeyRepository)(nil).DeleteAllSessions), ctx, userId)
|
||
|
}
|
||
|
|
||
|
// DeleteSession mocks base method.
|
||
|
func (m *MockValkeyRepository) DeleteSession(ctx context.Context, sessionId string) error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "DeleteSession", ctx, sessionId)
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// DeleteSession indicates an expected call of DeleteSession.
|
||
|
func (mr *MockValkeyRepositoryMockRecorder) DeleteSession(ctx, sessionId any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSession", reflect.TypeOf((*MockValkeyRepository)(nil).DeleteSession), ctx, sessionId)
|
||
|
}
|
||
|
|
||
|
// ReadSession mocks base method.
|
||
|
func (m *MockValkeyRepository) ReadSession(ctx context.Context, sessionId string) (*models.Session, error) {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "ReadSession", ctx, sessionId)
|
||
|
ret0, _ := ret[0].(*models.Session)
|
||
|
ret1, _ := ret[1].(error)
|
||
|
return ret0, ret1
|
||
|
}
|
||
|
|
||
|
// ReadSession indicates an expected call of ReadSession.
|
||
|
func (mr *MockValkeyRepositoryMockRecorder) ReadSession(ctx, sessionId any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadSession", reflect.TypeOf((*MockValkeyRepository)(nil).ReadSession), ctx, sessionId)
|
||
|
}
|
||
|
|
||
|
// UpdateSession mocks base method.
|
||
|
func (m *MockValkeyRepository) UpdateSession(ctx context.Context, sessionId string) error {
|
||
|
m.ctrl.T.Helper()
|
||
|
ret := m.ctrl.Call(m, "UpdateSession", ctx, sessionId)
|
||
|
ret0, _ := ret[0].(error)
|
||
|
return ret0
|
||
|
}
|
||
|
|
||
|
// UpdateSession indicates an expected call of UpdateSession.
|
||
|
func (mr *MockValkeyRepositoryMockRecorder) UpdateSession(ctx, sessionId any) *gomock.Call {
|
||
|
mr.mock.ctrl.T.Helper()
|
||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSession", reflect.TypeOf((*MockValkeyRepository)(nil).UpdateSession), ctx, sessionId)
|
||
|
}
|