repository

package
v0.0.0-...-00df602 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockRepository

type MockRepository struct {
	mock.Mock
}

MockRepository is an autogenerated mock type for the Repository type

func NewMockRepository

func NewMockRepository(t mockConstructorTestingTNewMockRepository) *MockRepository

NewMockRepository creates a new instance of MockRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockRepository) DeleteUser

func (_m *MockRepository) DeleteUser(id uint) error

DeleteUser provides a mock function with given fields: id

func (*MockRepository) InsertUser

func (_m *MockRepository) InsertUser(user *model.User) error

InsertUser provides a mock function with given fields: user

func (*MockRepository) SelectUser

func (_m *MockRepository) SelectUser(id uint) (*model.User, error)

SelectUser provides a mock function with given fields: id

func (*MockRepository) SelectUserByEmail

func (_m *MockRepository) SelectUserByEmail(email string) (*model.User, error)

SelectUserByEmail provides a mock function with given fields: email

func (*MockRepository) SelectUsers

func (_m *MockRepository) SelectUsers() ([]model.User, error)

SelectUsers provides a mock function with given fields:

func (*MockRepository) UpdateUser

func (_m *MockRepository) UpdateUser(user *model.User) error

UpdateUser provides a mock function with given fields: user

type Repository

type Repository interface {
	InsertUser(user *model.User) error
	SelectUser(id uint) (*model.User, error)
	SelectUserByEmail(email string) (*model.User, error)
	SelectUsers() ([]model.User, error)
	UpdateUser(user *model.User) error
	DeleteUser(id uint) error
}

func NewRepository

func NewRepository() Repository

NewRepository creates a new repository interface instance containing a db connection. Panics on failure to estasblish connection with db.

Jump to

Keyboard shortcuts

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