postgres

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

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

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(postgresHost, postgresUser, postgresPassword, postgresDBName string, postgresPort int) (db.PostgresDB, error)

Connecting to a PostgreSQL database

Types

type PDB

type PDB struct {
	DB *gorm.DB
}

func (*PDB) CheckUserEmail

func (d *PDB) CheckUserEmail(email string) bool

func (*PDB) CheckUserPassword

func (d *PDB) CheckUserPassword(password, email string) (err error)

func (*PDB) CheckUserUsername

func (d *PDB) CheckUserUsername(username string) bool

func (*PDB) CrateUser

func (d *PDB) CrateUser(model models.Users) (userId int, err error)

func (*PDB) CreateList

func (d *PDB) CreateList(model models.Lists) error

func (*PDB) CreateSubtask

func (d *PDB) CreateSubtask(model models.Tasks) error

func (*PDB) CreateTask

func (d *PDB) CreateTask(model models.Tasks) error

func (*PDB) DeleteList

func (d *PDB) DeleteList(id int) error

func (*PDB) DeleteSubtask

func (d *PDB) DeleteSubtask(id int) error

func (*PDB) DeleteTask

func (d *PDB) DeleteTask(id int) error

func (*PDB) DeleteUser

func (d *PDB) DeleteUser(storage db.MinIOClient, ctx context.Context, model models.Users) error

func (*PDB) GetAllSubtasks

func (d *PDB) GetAllSubtasks(taskId int) (subTasksData []models.SubtasksData)

func (*PDB) GetAllTasks

func (d *PDB) GetAllTasks(listId int) (tasksData []models.TasksData)

func (*PDB) GetAllUserLists

func (d *PDB) GetAllUserLists(userId int) (listsData []models.ListsData)

func (*PDB) GetListById

func (d *PDB) GetListById(id int) (listData models.Lists)

func (*PDB) GetListByIdAndUserId

func (d *PDB) GetListByIdAndUserId(id, userId int) (listData models.Lists)

func (*PDB) GetListIdWhereTask

func (d *PDB) GetListIdWhereTask(userId, taskId int) (listId int)

func (*PDB) GetListMaxIndex

func (d *PDB) GetListMaxIndex(userId int) (index int)

func (*PDB) GetListsForEditIndex

func (d *PDB) GetListsForEditIndex(userId, listIndex int) (listData []models.Lists)

func (*PDB) GetSubtaskMaxIndex

func (d *PDB) GetSubtaskMaxIndex(taskId int) (index int)

func (*PDB) GetSubtasksForEditIndex

func (d *PDB) GetSubtasksForEditIndex(taskId, subtaskIndex int) (subtaskData []models.Tasks)

func (*PDB) GetTaskById

func (d *PDB) GetTaskById(id int) (taksData models.Tasks)

func (*PDB) GetTaskIdWhereSubtask

func (d *PDB) GetTaskIdWhereSubtask(subtaskId int) (taskId int)

func (*PDB) GetTaskMaxIndex

func (d *PDB) GetTaskMaxIndex(listId int) (index int)

func (*PDB) GetTasksForEditIndex

func (d *PDB) GetTasksForEditIndex(listId, taskIndex int) (taskData []models.Tasks)

func (*PDB) GetUser

func (d *PDB) GetUser(model models.Users) (userData models.Users)

func (*PDB) GetUserByEmail

func (d *PDB) GetUserByEmail(email string) (userData models.Users)

func (*PDB) GetUserById

func (d *PDB) GetUserById(id int) (userData models.Users)

func (*PDB) UpdateListData

func (d *PDB) UpdateListData(model models.Lists) error

func (*PDB) UpdateListIndex

func (d *PDB) UpdateListIndex(listId, index int) error

func (*PDB) UpdateListsIndexes

func (d *PDB) UpdateListsIndexes(model models.Lists) (err error)

func (*PDB) UpdateSubtasksIndexes

func (d *PDB) UpdateSubtasksIndexes(model models.Tasks) (err error)

func (*PDB) UpdateTaskData

func (d *PDB) UpdateTaskData(model models.Tasks) error

func (*PDB) UpdateTaskIndex

func (d *PDB) UpdateTaskIndex(id, index int) error

func (*PDB) UpdateTasksIndexes

func (d *PDB) UpdateTasksIndexes(model models.Tasks) (err error)

func (*PDB) UpdateUser

func (d *PDB) UpdateUser(where, model models.Users) error

func (*PDB) UpdateUserIcon

func (d *PDB) UpdateUserIcon(id int, icon string) error

func (*PDB) UpdateUserPassword

func (d *PDB) UpdateUserPassword(password, email string) (err error)

Jump to

Keyboard shortcuts

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