mocks

package
v0.0.0-...-9fe57bb Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoriesDBMock

type CategoriesDBMock struct {
	Categories []models.Category
}

CategoriesDBMock is a CategoriesDB repository mock

func (*CategoriesDBMock) Create

func (cr *CategoriesDBMock) Create(userID uint64, category models.Category) (models.Category, error)

Create creates a new category in db

func (*CategoriesDBMock) Delete

func (cr *CategoriesDBMock) Delete(userID uint64, id interface{}) error

Delete removes a category from db

func (*CategoriesDBMock) Get

func (cr *CategoriesDBMock) Get(userID uint64, id interface{}) (models.Category, error)

func (*CategoriesDBMock) GetAll

func (cr *CategoriesDBMock) GetAll(userID uint64) ([]models.Category, error)

func (*CategoriesDBMock) Summary

func (cr *CategoriesDBMock) Summary(userID uint64) (models.CategoriesSummaryVM, error)

func (*CategoriesDBMock) Update

func (cr *CategoriesDBMock) Update(userID uint64, category models.Category) (models.Category, error)

Update updates a category in db

type CommentsDBMock

type CommentsDBMock struct {
	Comments []models.Comment
}

func (*CommentsDBMock) Create

func (cm *CommentsDBMock) Create(userID uint64, comment models.Comment) (models.Comment, error)

Create creates a new comment in db

func (*CommentsDBMock) Delete

func (cm *CommentsDBMock) Delete(userID uint64, id interface{}) error

Delete removes a comment from db

func (*CommentsDBMock) Get

func (cm *CommentsDBMock) Get(userID uint64, id interface{}) (models.Comment, error)

Get fetches a comment by its id

func (*CommentsDBMock) GetAll

func (cm *CommentsDBMock) GetAll(userID uint64, taskID interface{}) ([]models.Comment, error)

GetAll returns all comments owned by specified user

func (*CommentsDBMock) Update

func (cm *CommentsDBMock) Update(userID uint64, comment models.Comment) (models.Comment, error)

Update updates a comment in db

type EmailMock

type EmailMock struct {
	ActivationSent        bool
	RegistrationSent      bool
	ResetSent             bool
	ResetConfirmationSent bool
}

EmailMock is a email service mock

func (*EmailMock) SendPasswordResetConfirmation

func (e *EmailMock) SendPasswordResetConfirmation(c *gin.Context, user *models.User) error

func (*EmailMock) SendPasswordResetMessage

func (e *EmailMock) SendPasswordResetMessage(c *gin.Context, user *models.User) error

func (*EmailMock) SendUserActivationMessage

func (e *EmailMock) SendUserActivationMessage(c *gin.Context, user *models.User) error

func (*EmailMock) SendUserRegistrationMessage

func (e *EmailMock) SendUserRegistrationMessage(c *gin.Context, user *models.User) error

type PagesDBMock

type PagesDBMock struct {
	Pages []models.Page
}

func (*PagesDBMock) Create

func (pm *PagesDBMock) Create(page models.Page) (models.Page, error)

Create pmeates a new page in db

func (*PagesDBMock) Delete

func (pm *PagesDBMock) Delete(id interface{}) error

Delete removes a page from db

func (*PagesDBMock) Get

func (pm *PagesDBMock) Get(id interface{}) (models.Page, error)

Get fetches a page by its id

func (*PagesDBMock) GetAll

func (pm *PagesDBMock) GetAll() ([]models.Page, error)

GetAll returns all pages owned by specified user

func (*PagesDBMock) GetPagesForMenu

func (pm *PagesDBMock) GetPagesForMenu() ([]models.Page, error)

GetPagesForMenu returns a list of pages for navbar menu

func (*PagesDBMock) Update

func (pm *PagesDBMock) Update(page models.Page) (models.Page, error)

Update updates a page in db

type ProjectsDBMock

type ProjectsDBMock struct {
	Projects []models.Project
}

func (*ProjectsDBMock) Create

func (pr *ProjectsDBMock) Create(userID uint64, project models.Project) (models.Project, error)

Create preates a new project in db

func (*ProjectsDBMock) Delete

func (pr *ProjectsDBMock) Delete(userID uint64, id interface{}) error

Delete removes a project from db

func (*ProjectsDBMock) Get

func (pr *ProjectsDBMock) Get(userID uint64, id interface{}) (models.Project, error)

Get fetches a project by its id

func (*ProjectsDBMock) GetAll

func (pr *ProjectsDBMock) GetAll(userID uint64) ([]models.Project, error)

GetAll returns all projects owned by the specified user

func (*ProjectsDBMock) GetAllFavorite

func (pr *ProjectsDBMock) GetAllFavorite(userID uint64) ([]models.Project, error)

GetAllFavorite returns all favorite projects owned by the specified user

func (*ProjectsDBMock) GetEdit

func (pr *ProjectsDBMock) GetEdit(userID uint64, id interface{}) (models.EditProjectVM, error)

GetEdit returns a viewmodel with data required for editing the project

func (*ProjectsDBMock) GetNew

func (pr *ProjectsDBMock) GetNew(userID uint64) (models.EditProjectVM, error)

GetNew returns a viewmodel with data required for building a new project

func (*ProjectsDBMock) Summary

func (pr *ProjectsDBMock) Summary(userID uint64) (models.ProjectsSummaryVM, error)

Summary gets projects summary info for a dashboard

func (*ProjectsDBMock) ToggleArchive

func (pr *ProjectsDBMock) ToggleArchive(userID uint64, project models.Project) (models.Project, error)

ToggleArchive toggles project's archived field

func (*ProjectsDBMock) ToggleFavorite

func (pr *ProjectsDBMock) ToggleFavorite(userID uint64, project models.Project) (models.Project, error)

ToggleFavorite toggles project's favorite field

func (*ProjectsDBMock) Update

func (pr *ProjectsDBMock) Update(userID uint64, project models.Project) (models.Project, error)

Update updates a project in db

type ReportsDBMock

type ReportsDBMock struct {
	Logs []models.TaskLog
}

func (*ReportsDBMock) Spent

func (r *ReportsDBMock) Spent(userID uint64) ([]models.TaskLog, error)

Spent returns spent report data

type SessionsDBMock

type SessionsDBMock struct {
	Sessions []models.Session
}

SessionsDBMock is a SessionsDB repository mock

func (*SessionsDBMock) Create

func (cr *SessionsDBMock) Create(userID uint64, session models.Session) (models.Session, error)

Create creates a new session in db

func (*SessionsDBMock) Delete

func (cr *SessionsDBMock) Delete(userID uint64, id interface{}) error

Delete removes a session from db

func (*SessionsDBMock) Get

func (cr *SessionsDBMock) Get(userID uint64, id interface{}) (models.Session, error)

func (*SessionsDBMock) GetAll

func (cr *SessionsDBMock) GetAll(userID uint64) ([]models.Session, error)

func (*SessionsDBMock) NewGet

func (cr *SessionsDBMock) NewGet(userID uint64) (models.Session, error)

NewGet gets a view models for a new session

func (*SessionsDBMock) Summary

func (cr *SessionsDBMock) Summary(userID uint64) (models.SessionsSummaryVM, error)

Summary returs session summary

type SettingsDBMock

type SettingsDBMock struct {
	Settings []models.Setting
}

func (*SettingsDBMock) Create

func (sm *SettingsDBMock) Create(setting models.Setting) (models.Setting, error)

Create smeates a new setting in db

func (*SettingsDBMock) Delete

func (sm *SettingsDBMock) Delete(id interface{}) error

Delete removes a setting from db

func (*SettingsDBMock) Get

func (sm *SettingsDBMock) Get(id interface{}) (models.Setting, error)

Get fetches a setting by its id

func (*SettingsDBMock) GetAll

func (sm *SettingsDBMock) GetAll() ([]models.Setting, error)

GetAll returns all settings owned by specified user

func (*SettingsDBMock) Update

func (sm *SettingsDBMock) Update(setting models.Setting) (models.Setting, error)

Update updates a setting in db

type TaskLogsDBMock

type TaskLogsDBMock struct {
	TaskLogs []models.TaskLog
}

TaskLogsDBMock is a TaskLogsDB repository mock

func (*TaskLogsDBMock) Create

func (r *TaskLogsDBMock) Create(userID uint64, taskLog models.TaskLog) (models.TaskLog, error)

Create inserts new record in db

func (*TaskLogsDBMock) Latest

func (r *TaskLogsDBMock) Latest(userID uint64) ([]models.TaskLog, error)

Latest returns a fixed number of latest task logs

func (*TaskLogsDBMock) Update

func (r *TaskLogsDBMock) Update(userID uint64, taskLog models.TaskLog) (models.TaskLog, error)

Update updates a taskLog in db

type TasksDBMock

type TasksDBMock struct {
	Tasks []models.Task
}

TasksDBMock is a TasksDB repository mock

func (*TasksDBMock) Create

func (tm *TasksDBMock) Create(userID uint64, task models.Task) (models.Task, error)

Create tmeates a new task in db

func (*TasksDBMock) Delete

func (tm *TasksDBMock) Delete(userID uint64, id interface{}) error

Delete removes a task from db

func (*TasksDBMock) Get

func (tm *TasksDBMock) Get(userID uint64, id interface{}) (models.Task, error)

func (*TasksDBMock) GetAll

func (tm *TasksDBMock) GetAll(userID uint64) ([]models.Task, error)

func (*TasksDBMock) GetEdit

func (tm *TasksDBMock) GetEdit(userID uint64, id interface{}) (models.EditTaskVM, error)

func (*TasksDBMock) GetNew

func (tm *TasksDBMock) GetNew(userID uint64, projectID uint64) (models.EditTaskVM, error)

GetNew returns a view model for creating a new task

func (*TasksDBMock) Latest

func (tm *TasksDBMock) Latest(userID uint64) ([]models.Task, error)

Latest returns a fixed number of latest tasks

func (*TasksDBMock) Summary

func (tm *TasksDBMock) Summary(userID uint64) (models.TasksSummaryVM, error)

Summary returns tasks summary

func (*TasksDBMock) Update

func (tm *TasksDBMock) Update(userID uint64, task models.Task) (models.Task, error)

Update updates a task in db

type UsersDBMock

type UsersDBMock struct {
	Users []models.User
}

UsersDBMock is a UsersDB repository mock

func (*UsersDBMock) Activate

func (u *UsersDBMock) Activate(vm models.ActivateVM) (models.User, error)

func (*UsersDBMock) Forgot

func (u *UsersDBMock) Forgot(vm models.ForgotVM) (models.User, error)

func (*UsersDBMock) Get

func (u *UsersDBMock) Get(id interface{}) (models.User, error)

func (*UsersDBMock) GetAll

func (u *UsersDBMock) GetAll() ([]models.User, error)

func (*UsersDBMock) GetByEmail

func (u *UsersDBMock) GetByEmail(email string) (models.User, error)

func (*UsersDBMock) Login

func (u *UsersDBMock) Login(vm models.LoginVM) (models.User, error)

func (*UsersDBMock) Register

func (u *UsersDBMock) Register(vm models.RegisterVM) (models.User, error)

func (*UsersDBMock) ResetPassword

func (u *UsersDBMock) ResetPassword(vm models.ResetVM) (models.User, error)

func (*UsersDBMock) Summary

func (u *UsersDBMock) Summary() (models.UsersSummaryVM, error)

func (*UsersDBMock) UpdateAccount

func (u *UsersDBMock) UpdateAccount(vm models.AccountVM, user models.User) (models.User, error)

func (*UsersDBMock) UpdateStatus

func (u *UsersDBMock) UpdateStatus(user models.User) (models.User, error)

Jump to

Keyboard shortcuts

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