Documentation ¶
Index ¶
- func AddCategory(username, category string) error
- func AddComments(username string, id int, comment string) error
- func AddFile(fileName, token, username string) error
- func AddTask(title, content, category string, taskPriority int, username string, hidden int) error
- func Close()
- func CompleteTask(username string, id int) error
- func CreateUser(username, password, email string) error
- func DeleteAll(username string) error
- func DeleteCategoryByName(username, category string) error
- func DeleteCommentByID(username string, id int) error
- func DeleteTask(username string, id int) error
- func GetCategories(username string) []types.CategoryCount
- func GetCategoryByName(username, category string) int
- func GetCategoryIDByName(username string, category string) int
- func GetComments(username string) (map[int][]types.Comment, error)
- func GetFileName(token string) (string, error)
- func GetTaskByID(username string, id int) (types.Context, error)
- func GetTasks(username, status, category string) (types.Context, error)
- func GetUserID(username string) (int, error)
- func RestoreTask(username string, id int) error
- func RestoreTaskFromComplete(username string, id int) error
- func SearchTask(username, query string) (types.Context, error)
- func TrashTask(username string, id int) error
- func UpdateCategoryByName(username, oldName, newName string) error
- func UpdateTask(id int, title, content, category string, priority int, username string, ...) error
- func ValidUser(username, password string) bool
- type Database
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCategory ¶
AddCategory is used to add the task in the database
func AddComments ¶
AddComments will be used to add comments in the database
func AddFile ¶
AddFile is used to add the md5 of a file name which is uploaded to our application this will enable us to randomize the URL without worrying about the file names
func CompleteTask ¶
CompleteTask is used to mark tasks as complete
func CreateUser ¶
CreateUser will create a new user, take as input the parameters and insert it into database
func DeleteCategoryByName ¶
DeleteCategoryByName will be used to delete a category from the category page
func DeleteCommentByID ¶
DeleteCommentByID will actually delete the comment from db
func DeleteTask ¶
DeleteTask is used to delete the task from the database
func GetCategories ¶
func GetCategories(username string) []types.CategoryCount
GetCategories will return the list of categories to be rendered in the template
func GetCategoryByName ¶
GetCategoryByName will return the ID of that category passed as args used while inserting tasks into the table
func GetCategoryIDByName ¶
GetCategoryIDByName will return the category ID for the category, used in the edit task function where we need to be able to update the categoryID of the task
func GetComments ¶
GetComments is used to get comments, all of them. We do not want 100 different pages to show tasks, we want to use as few pages as possible so we are going to populate everything on the damn home pages
func GetFileName ¶
GetFileName is used to fetch the name according to the md5 checksum from the db
func GetTaskByID ¶
GetTaskByID function gets the tasks from the ID passed to the function, used to populate EditTask
func GetTasks ¶
GetTasks retrieves all the tasks depending on the status pending or trashed or completed
func RestoreTask ¶
RestoreTask is used to restore tasks from the Trash
func RestoreTaskFromComplete ¶
RestoreTaskFromComplete is used to restore tasks from the Trash
func SearchTask ¶
SearchTask is used to return the search results depending on the query
func UpdateCategoryByName ¶
UpdateCategoryByName will be used to delete a category from the category page