repository

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package repository is a generated GoMock package.

Package repository is a generated GoMock package.

Package repository is a generated GoMock package.

Package repository is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrMachineAlreadyExists = errors.New("machine w/ user already exists")
View Source
var ErrUserAlreadyExists = errors.New("user already exists")

Functions

This section is empty.

Types

type MachineRepo

type MachineRepo struct {
	Injector *do.Injector
}

func (*MachineRepo) CreateMachine

func (repo *MachineRepo) CreateMachine(machine *models.Machine) (*models.Machine, error)

func (*MachineRepo) CreateMachineTx

func (repo *MachineRepo) CreateMachineTx(machine *models.Machine, tx pgx.Tx) (*models.Machine, error)

func (*MachineRepo) DeleteMachine

func (repo *MachineRepo) DeleteMachine(id uuid.UUID) error

func (*MachineRepo) GetMachine

func (repo *MachineRepo) GetMachine(id uuid.UUID) (*models.Machine, error)

func (*MachineRepo) GetMachineByNameAndUser

func (repo *MachineRepo) GetMachineByNameAndUser(machineName string, userID uuid.UUID) (*models.Machine, error)

func (*MachineRepo) GetUserMachines

func (repo *MachineRepo) GetUserMachines(id uuid.UUID) ([]models.Machine, error)

type MachineRepository

type MachineRepository interface {
	DeleteMachine(id uuid.UUID) error
	GetMachine(id uuid.UUID) (*models.Machine, error)
	GetMachineByNameAndUser(machineName string, userID uuid.UUID) (*models.Machine, error)
	CreateMachine(machine *models.Machine) (*models.Machine, error)
	CreateMachineTx(machine *models.Machine, tx pgx.Tx) (*models.Machine, error)
	GetUserMachines(id uuid.UUID) ([]models.Machine, error)
}

type MockMachineRepository

type MockMachineRepository struct {
	// contains filtered or unexported fields
}

MockMachineRepository is a mock of MachineRepository interface.

func NewMockMachineRepository

func NewMockMachineRepository(ctrl *gomock.Controller) *MockMachineRepository

NewMockMachineRepository creates a new mock instance.

func (*MockMachineRepository) CreateMachine

func (m *MockMachineRepository) CreateMachine(machine *models.Machine) (*models.Machine, error)

CreateMachine mocks base method.

func (*MockMachineRepository) CreateMachineTx

func (m *MockMachineRepository) CreateMachineTx(machine *models.Machine, tx pgx.Tx) (*models.Machine, error)

CreateMachineTx mocks base method.

func (*MockMachineRepository) DeleteMachine

func (m *MockMachineRepository) DeleteMachine(id uuid.UUID) error

DeleteMachine mocks base method.

func (*MockMachineRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMachineRepository) GetMachine

func (m *MockMachineRepository) GetMachine(id uuid.UUID) (*models.Machine, error)

GetMachine mocks base method.

func (*MockMachineRepository) GetMachineByNameAndUser

func (m *MockMachineRepository) GetMachineByNameAndUser(machineName string, userID uuid.UUID) (*models.Machine, error)

GetMachineByNameAndUser mocks base method.

func (*MockMachineRepository) GetUserMachines

func (m *MockMachineRepository) GetUserMachines(id uuid.UUID) ([]models.Machine, error)

GetUserMachines mocks base method.

type MockMachineRepositoryMockRecorder

type MockMachineRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockMachineRepositoryMockRecorder is the mock recorder for MockMachineRepository.

func (*MockMachineRepositoryMockRecorder) CreateMachine

func (mr *MockMachineRepositoryMockRecorder) CreateMachine(machine interface{}) *gomock.Call

CreateMachine indicates an expected call of CreateMachine.

func (*MockMachineRepositoryMockRecorder) CreateMachineTx

func (mr *MockMachineRepositoryMockRecorder) CreateMachineTx(machine, tx interface{}) *gomock.Call

CreateMachineTx indicates an expected call of CreateMachineTx.

func (*MockMachineRepositoryMockRecorder) DeleteMachine

func (mr *MockMachineRepositoryMockRecorder) DeleteMachine(id interface{}) *gomock.Call

DeleteMachine indicates an expected call of DeleteMachine.

func (*MockMachineRepositoryMockRecorder) GetMachine

func (mr *MockMachineRepositoryMockRecorder) GetMachine(id interface{}) *gomock.Call

GetMachine indicates an expected call of GetMachine.

func (*MockMachineRepositoryMockRecorder) GetMachineByNameAndUser

func (mr *MockMachineRepositoryMockRecorder) GetMachineByNameAndUser(machineName, userID interface{}) *gomock.Call

GetMachineByNameAndUser indicates an expected call of GetMachineByNameAndUser.

func (*MockMachineRepositoryMockRecorder) GetUserMachines

func (mr *MockMachineRepositoryMockRecorder) GetUserMachines(id interface{}) *gomock.Call

GetUserMachines indicates an expected call of GetUserMachines.

type MockSshConfigRepository

type MockSshConfigRepository struct {
	// contains filtered or unexported fields
}

MockSshConfigRepository is a mock of SshConfigRepository interface.

func NewMockSshConfigRepository

func NewMockSshConfigRepository(ctrl *gomock.Controller) *MockSshConfigRepository

NewMockSshConfigRepository creates a new mock instance.

func (*MockSshConfigRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSshConfigRepository) GetSshConfig

func (m *MockSshConfigRepository) GetSshConfig(machineID, userID uuid.UUID) (*models.SshConfig, error)

GetSshConfig mocks base method.

func (*MockSshConfigRepository) UpsertSshConfig

func (m *MockSshConfigRepository) UpsertSshConfig(config *models.SshConfig) (*models.SshConfig, error)

UpsertSshConfig mocks base method.

func (*MockSshConfigRepository) UpsertSshConfigTx

func (m *MockSshConfigRepository) UpsertSshConfigTx(config *models.SshConfig, tx pgx.Tx) (*models.SshConfig, error)

UpsertSshConfigTx mocks base method.

type MockSshConfigRepositoryMockRecorder

type MockSshConfigRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockSshConfigRepositoryMockRecorder is the mock recorder for MockSshConfigRepository.

func (*MockSshConfigRepositoryMockRecorder) GetSshConfig

func (mr *MockSshConfigRepositoryMockRecorder) GetSshConfig(machineID, userID interface{}) *gomock.Call

GetSshConfig indicates an expected call of GetSshConfig.

func (*MockSshConfigRepositoryMockRecorder) UpsertSshConfig

func (mr *MockSshConfigRepositoryMockRecorder) UpsertSshConfig(config interface{}) *gomock.Call

UpsertSshConfig indicates an expected call of UpsertSshConfig.

func (*MockSshConfigRepositoryMockRecorder) UpsertSshConfigTx

func (mr *MockSshConfigRepositoryMockRecorder) UpsertSshConfigTx(config, tx interface{}) *gomock.Call

UpsertSshConfigTx indicates an expected call of UpsertSshConfigTx.

type MockSshKeyRepository

type MockSshKeyRepository struct {
	// contains filtered or unexported fields
}

MockSshKeyRepository is a mock of SshKeyRepository interface.

func NewMockSshKeyRepository

func NewMockSshKeyRepository(ctrl *gomock.Controller) *MockSshKeyRepository

NewMockSshKeyRepository creates a new mock instance.

func (*MockSshKeyRepository) CreateSshKey

func (m *MockSshKeyRepository) CreateSshKey(sshKey *models.SshKey) (*models.SshKey, error)

CreateSshKey mocks base method.

func (*MockSshKeyRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSshKeyRepository) UpsertSshKey

func (m *MockSshKeyRepository) UpsertSshKey(sshKey *models.SshKey) (*models.SshKey, error)

UpsertSshKey mocks base method.

func (*MockSshKeyRepository) UpsertSshKeyTx

func (m *MockSshKeyRepository) UpsertSshKeyTx(sshKey *models.SshKey, tx pgx.Tx) (*models.SshKey, error)

UpsertSshKeyTx mocks base method.

type MockSshKeyRepositoryMockRecorder

type MockSshKeyRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockSshKeyRepositoryMockRecorder is the mock recorder for MockSshKeyRepository.

func (*MockSshKeyRepositoryMockRecorder) CreateSshKey

func (mr *MockSshKeyRepositoryMockRecorder) CreateSshKey(sshKey interface{}) *gomock.Call

CreateSshKey indicates an expected call of CreateSshKey.

func (*MockSshKeyRepositoryMockRecorder) UpsertSshKey

func (mr *MockSshKeyRepositoryMockRecorder) UpsertSshKey(sshKey interface{}) *gomock.Call

UpsertSshKey indicates an expected call of UpsertSshKey.

func (*MockSshKeyRepositoryMockRecorder) UpsertSshKeyTx

func (mr *MockSshKeyRepositoryMockRecorder) UpsertSshKeyTx(sshKey, tx interface{}) *gomock.Call

UpsertSshKeyTx indicates an expected call of UpsertSshKeyTx.

type MockUserRepository

type MockUserRepository struct {
	// contains filtered or unexported fields
}

MockUserRepository is a mock of UserRepository interface.

func NewMockUserRepository

func NewMockUserRepository(ctrl *gomock.Controller) *MockUserRepository

NewMockUserRepository creates a new mock instance.

func (*MockUserRepository) AddAndUpdateConfig

func (m *MockUserRepository) AddAndUpdateConfig(user *models.User) error

AddAndUpdateConfig mocks base method.

func (*MockUserRepository) AddAndUpdateConfigTx

func (m *MockUserRepository) AddAndUpdateConfigTx(user *models.User, tx pgx.Tx) error

AddAndUpdateConfigTx mocks base method.

func (*MockUserRepository) AddAndUpdateKeys

func (m *MockUserRepository) AddAndUpdateKeys(user *models.User) error

AddAndUpdateKeys mocks base method.

func (*MockUserRepository) AddAndUpdateKeysTx

func (m *MockUserRepository) AddAndUpdateKeysTx(user *models.User, tx pgx.Tx) error

AddAndUpdateKeysTx mocks base method.

func (*MockUserRepository) CreateUser

func (m *MockUserRepository) CreateUser(user *models.User) (*models.User, error)

CreateUser mocks base method.

func (*MockUserRepository) CreateUserTx

func (m *MockUserRepository) CreateUserTx(user *models.User, tx pgx.Tx) (*models.User, error)

CreateUserTx mocks base method.

func (*MockUserRepository) DeleteUser

func (m *MockUserRepository) DeleteUser(id uuid.UUID) error

DeleteUser mocks base method.

func (*MockUserRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserRepository) GetUser

func (m *MockUserRepository) GetUser(id uuid.UUID) (*models.User, error)

GetUser mocks base method.

func (*MockUserRepository) GetUserByUsername

func (m *MockUserRepository) GetUserByUsername(username string) (*models.User, error)

GetUserByUsername mocks base method.

func (*MockUserRepository) GetUserConfig

func (m *MockUserRepository) GetUserConfig(id uuid.UUID) ([]models.SshConfig, error)

GetUserConfig mocks base method.

func (*MockUserRepository) GetUserKeys

func (m *MockUserRepository) GetUserKeys(id uuid.UUID) ([]models.SshKey, error)

GetUserKeys mocks base method.

type MockUserRepositoryMockRecorder

type MockUserRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserRepositoryMockRecorder is the mock recorder for MockUserRepository.

func (*MockUserRepositoryMockRecorder) AddAndUpdateConfig

func (mr *MockUserRepositoryMockRecorder) AddAndUpdateConfig(user interface{}) *gomock.Call

AddAndUpdateConfig indicates an expected call of AddAndUpdateConfig.

func (*MockUserRepositoryMockRecorder) AddAndUpdateConfigTx

func (mr *MockUserRepositoryMockRecorder) AddAndUpdateConfigTx(user, tx interface{}) *gomock.Call

AddAndUpdateConfigTx indicates an expected call of AddAndUpdateConfigTx.

func (*MockUserRepositoryMockRecorder) AddAndUpdateKeys

func (mr *MockUserRepositoryMockRecorder) AddAndUpdateKeys(user interface{}) *gomock.Call

AddAndUpdateKeys indicates an expected call of AddAndUpdateKeys.

func (*MockUserRepositoryMockRecorder) AddAndUpdateKeysTx

func (mr *MockUserRepositoryMockRecorder) AddAndUpdateKeysTx(user, tx interface{}) *gomock.Call

AddAndUpdateKeysTx indicates an expected call of AddAndUpdateKeysTx.

func (*MockUserRepositoryMockRecorder) CreateUser

func (mr *MockUserRepositoryMockRecorder) CreateUser(user interface{}) *gomock.Call

CreateUser indicates an expected call of CreateUser.

func (*MockUserRepositoryMockRecorder) CreateUserTx

func (mr *MockUserRepositoryMockRecorder) CreateUserTx(user, tx interface{}) *gomock.Call

CreateUserTx indicates an expected call of CreateUserTx.

func (*MockUserRepositoryMockRecorder) DeleteUser

func (mr *MockUserRepositoryMockRecorder) DeleteUser(id interface{}) *gomock.Call

DeleteUser indicates an expected call of DeleteUser.

func (*MockUserRepositoryMockRecorder) GetUser

func (mr *MockUserRepositoryMockRecorder) GetUser(id interface{}) *gomock.Call

GetUser indicates an expected call of GetUser.

func (*MockUserRepositoryMockRecorder) GetUserByUsername

func (mr *MockUserRepositoryMockRecorder) GetUserByUsername(username interface{}) *gomock.Call

GetUserByUsername indicates an expected call of GetUserByUsername.

func (*MockUserRepositoryMockRecorder) GetUserConfig

func (mr *MockUserRepositoryMockRecorder) GetUserConfig(id interface{}) *gomock.Call

GetUserConfig indicates an expected call of GetUserConfig.

func (*MockUserRepositoryMockRecorder) GetUserKeys

func (mr *MockUserRepositoryMockRecorder) GetUserKeys(id interface{}) *gomock.Call

GetUserKeys indicates an expected call of GetUserKeys.

type SshConfigRepo

type SshConfigRepo struct {
	Injector *do.Injector
}

func (*SshConfigRepo) GetSshConfig

func (repo *SshConfigRepo) GetSshConfig(machineID uuid.UUID, userID uuid.UUID) (*models.SshConfig, error)

func (*SshConfigRepo) UpsertSshConfig

func (repo *SshConfigRepo) UpsertSshConfig(config *models.SshConfig) (*models.SshConfig, error)

func (*SshConfigRepo) UpsertSshConfigTx

func (repo *SshConfigRepo) UpsertSshConfigTx(config *models.SshConfig, tx pgx.Tx) (*models.SshConfig, error)

type SshConfigRepository

type SshConfigRepository interface {
	GetSshConfig(machineID uuid.UUID, userID uuid.UUID) (*models.SshConfig, error)
	UpsertSshConfig(config *models.SshConfig) (*models.SshConfig, error)
	UpsertSshConfigTx(config *models.SshConfig, tx pgx.Tx) (*models.SshConfig, error)
}

type SshKeyRepo

type SshKeyRepo struct {
	Injector *do.Injector
}

func (*SshKeyRepo) CreateSshKey

func (repo *SshKeyRepo) CreateSshKey(sshKey *models.SshKey) (*models.SshKey, error)

func (*SshKeyRepo) UpsertSshKey

func (repo *SshKeyRepo) UpsertSshKey(sshKey *models.SshKey) (*models.SshKey, error)

func (*SshKeyRepo) UpsertSshKeyTx

func (repo *SshKeyRepo) UpsertSshKeyTx(sshKey *models.SshKey, tx pgx.Tx) (*models.SshKey, error)

type SshKeyRepository

type SshKeyRepository interface {
	CreateSshKey(sshKey *models.SshKey) (*models.SshKey, error)
	UpsertSshKey(sshKey *models.SshKey) (*models.SshKey, error)
	UpsertSshKeyTx(sshKey *models.SshKey, tx pgx.Tx) (*models.SshKey, error)
}

type UserRepo

type UserRepo struct {
	Injector *do.Injector
}

func (*UserRepo) AddAndUpdateConfig

func (repo *UserRepo) AddAndUpdateConfig(user *models.User) error

func (*UserRepo) AddAndUpdateConfigTx

func (repo *UserRepo) AddAndUpdateConfigTx(user *models.User, tx pgx.Tx) error

func (*UserRepo) AddAndUpdateKeys

func (repo *UserRepo) AddAndUpdateKeys(user *models.User) error

func (*UserRepo) AddAndUpdateKeysTx

func (repo *UserRepo) AddAndUpdateKeysTx(user *models.User, tx pgx.Tx) error

func (*UserRepo) CreateUser

func (repo *UserRepo) CreateUser(user *models.User) (*models.User, error)

func (*UserRepo) CreateUserTx

func (repo *UserRepo) CreateUserTx(user *models.User, tx pgx.Tx) (*models.User, error)

func (*UserRepo) DeleteUser

func (repo *UserRepo) DeleteUser(id uuid.UUID) error

func (*UserRepo) GetUser

func (repo *UserRepo) GetUser(userId uuid.UUID) (*models.User, error)

func (*UserRepo) GetUserByUsername

func (repo *UserRepo) GetUserByUsername(username string) (*models.User, error)

func (*UserRepo) GetUserConfig

func (repo *UserRepo) GetUserConfig(id uuid.UUID) ([]models.SshConfig, error)

func (*UserRepo) GetUserKeys

func (repo *UserRepo) GetUserKeys(id uuid.UUID) ([]models.SshKey, error)

type UserRepository

type UserRepository interface {
	GetUser(id uuid.UUID) (*models.User, error)
	GetUserByUsername(username string) (*models.User, error)
	CreateUser(user *models.User) (*models.User, error)
	CreateUserTx(user *models.User, tx pgx.Tx) (*models.User, error)
	DeleteUser(id uuid.UUID) error
	GetUserConfig(id uuid.UUID) ([]models.SshConfig, error)
	GetUserKeys(id uuid.UUID) ([]models.SshKey, error)
	AddAndUpdateKeys(user *models.User) error
	AddAndUpdateKeysTx(user *models.User, tx pgx.Tx) error
	AddAndUpdateConfig(user *models.User) error
	AddAndUpdateConfigTx(user *models.User, tx pgx.Tx) error
}

UserRepository interface for User repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL