mock

package
v0.0.0-...-8ae76b5 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModels

func NewModels(db *interface{}) interface{}

Types

type AccountModel

type AccountModel struct{}

func (*AccountModel) All

func (m *AccountModel) All(userID int64, filters models.Filters) ([]*models.Account, models.Metadata, error)

func (*AccountModel) Insert

func (m *AccountModel) Insert(name string, userID int64, currencyID int64, status string, showInSummary bool) (int64, error)

type AuthSessionModel

type AuthSessionModel struct{}

AuthSessionModel represents mocked AuthSessionModel

func (*AuthSessionModel) Delete

func (m *AuthSessionModel) Delete(id int64) error

Delete drops mocked auth session

func (*AuthSessionModel) Get

Get fetches mock auth session by ID

func (*AuthSessionModel) GetByToken

func (m *AuthSessionModel) GetByToken(token string) (*models.AuthSession, error)

GetByToken fetches mock auth session by token

func (*AuthSessionModel) Insert

func (m *AuthSessionModel) Insert(userID int64, token string) (int64, error)

Insert mocks auth session insert method

type CategoryModel

type CategoryModel struct{}

func (*CategoryModel) All

func (m *CategoryModel) All(userID int64, filters models.Filters) ([]*models.Category, models.Metadata, error)

func (*CategoryModel) Insert

func (m *CategoryModel) Insert(name string, categoryType models.CategoryType, userID int64, inactive bool) (int64, error)

type Models

type Models struct {
	Users UserModel
}

type TransactionModel

type TransactionModel struct{}

func (*TransactionModel) All

func (m *TransactionModel) All(userID int64, filters models.Filters) ([]*models.Transaction, models.Metadata, error)

func (*TransactionModel) Insert

func (m *TransactionModel) Insert(amount float64, comment string, userID, categoryID, accountID int64) (int64, error)

type UserModel

type UserModel struct{}

UserModel represents mock UserModel

func (*UserModel) Authenticate

func (m *UserModel) Authenticate(email, password string) (string, error)

Authenticate mock authenticate user

func (*UserModel) Confirm

func (m *UserModel) Confirm(id int64) error

Confirm mock user confirmation

func (*UserModel) Delete

func (m *UserModel) Delete(id int64) error

Delete mock delete user

func (*UserModel) Get

func (m *UserModel) Get(id int64) (*models.User, error)

Get mock fetching user by ID

func (*UserModel) GetByEmail

func (m *UserModel) GetByEmail(email string) (*models.User, error)

GetByEmail mock fetching user by Email

func (*UserModel) Insert

func (m *UserModel) Insert(email, password string) (int64, error)

Insert mock insert a new user

Jump to

Keyboard shortcuts

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