Documentation ¶
Index ¶
- func AddCategoryFunc(w http.ResponseWriter, r *http.Request)
- func AddCategoryFuncAPI(w http.ResponseWriter, r *http.Request)
- func AddCommentFunc(w http.ResponseWriter, r *http.Request)
- func AddTaskFunc(w http.ResponseWriter, r *http.Request)
- func AddTaskFuncAPI(w http.ResponseWriter, r *http.Request)
- func CompleteTaskFunc(w http.ResponseWriter, r *http.Request)
- func DeleteCategoryFunc(w http.ResponseWriter, r *http.Request)
- func DeleteCategoryFuncAPI(w http.ResponseWriter, r *http.Request)
- func DeleteCommentFunc(w http.ResponseWriter, r *http.Request)
- func DeleteTaskFunc(w http.ResponseWriter, r *http.Request)
- func DeleteTaskFuncAPI(w http.ResponseWriter, r *http.Request)
- func EditTaskFunc(w http.ResponseWriter, r *http.Request)
- func GetCategoryFuncAPI(w http.ResponseWriter, r *http.Request)
- func GetDeletedTaskFuncAPI(w http.ResponseWriter, r *http.Request)
- func GetTasksFuncAPI(w http.ResponseWriter, r *http.Request)
- func GetTokenHandler(w http.ResponseWriter, r *http.Request)
- func LoginFunc(w http.ResponseWriter, r *http.Request)
- func LogoutFunc(w http.ResponseWriter, r *http.Request)
- func PopulateTemplates()
- func RequiresLogin(handler func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)
- func RestoreFromCompleteFunc(w http.ResponseWriter, r *http.Request)
- func RestoreTaskFunc(w http.ResponseWriter, r *http.Request)
- func SearchTaskFunc(w http.ResponseWriter, r *http.Request)
- func ShowAllTasksFunc(w http.ResponseWriter, r *http.Request)
- func ShowCategoryFunc(w http.ResponseWriter, r *http.Request)
- func ShowCompleteTasksFunc(w http.ResponseWriter, r *http.Request)
- func ShowTrashTaskFunc(w http.ResponseWriter, r *http.Request)
- func SignUpFunc(w http.ResponseWriter, r *http.Request)
- func TrashTaskFunc(w http.ResponseWriter, r *http.Request)
- func UpdateCategoryFunc(w http.ResponseWriter, r *http.Request)
- func UpdateCategoryFuncAPI(w http.ResponseWriter, r *http.Request)
- func UpdateTaskFunc(w http.ResponseWriter, r *http.Request)
- func UpdateTaskFuncAPI(w http.ResponseWriter, r *http.Request)
- func UploadedFileHandler(w http.ResponseWriter, r *http.Request)
- func ValidateToken(myToken string) (bool, string)
- type MyCustomClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCategoryFunc ¶
func AddCategoryFunc(w http.ResponseWriter, r *http.Request)
AddCategoryFunc used to add new categories to the database
func AddCategoryFuncAPI ¶
func AddCategoryFuncAPI(w http.ResponseWriter, r *http.Request)
AddCategoryFuncAPI will add the category for the user
func AddCommentFunc ¶
func AddCommentFunc(w http.ResponseWriter, r *http.Request)
AddCommentFunc will be used
func AddTaskFunc ¶
func AddTaskFunc(w http.ResponseWriter, r *http.Request)
AddTaskFunc is used to handle the addition of new task, "/add" URL
func AddTaskFuncAPI ¶
func AddTaskFuncAPI(w http.ResponseWriter, r *http.Request)
AddTaskFuncAPI will add the tasks for the user
func CompleteTaskFunc ¶
func CompleteTaskFunc(w http.ResponseWriter, r *http.Request)
CompleteTaskFunc is used to show the complete tasks, handles "/completed/" url
func DeleteCategoryFunc ¶
func DeleteCategoryFunc(w http.ResponseWriter, r *http.Request)
DeleteCategoryFunc will delete any category
func DeleteCategoryFuncAPI ¶
func DeleteCategoryFuncAPI(w http.ResponseWriter, r *http.Request)
DeleteCategoryFuncAPI will delete the category for the user
func DeleteCommentFunc ¶
func DeleteCommentFunc(w http.ResponseWriter, r *http.Request)
DeleteCommentFunc will delete any category
func DeleteTaskFunc ¶
func DeleteTaskFunc(w http.ResponseWriter, r *http.Request)
DeleteTaskFunc is used to delete a task, trash = move to recycle bin, delete = permanent delete
func DeleteTaskFuncAPI ¶
func DeleteTaskFuncAPI(w http.ResponseWriter, r *http.Request)
DeleteTaskFuncAPI will add the tasks for the user
func EditTaskFunc ¶
func EditTaskFunc(w http.ResponseWriter, r *http.Request)
EditTaskFunc is used to edit tasks, handles "/edit/" URL
func GetCategoryFuncAPI ¶
func GetCategoryFuncAPI(w http.ResponseWriter, r *http.Request)
GetCategoryFuncAPI will return the categories for the user depends on the ID that we get, if we get all, then return all categories of the user
func GetDeletedTaskFuncAPI ¶
func GetDeletedTaskFuncAPI(w http.ResponseWriter, r *http.Request)
GetDeletedTaskFuncAPI will get the deleted tasks for the user
func GetTasksFuncAPI ¶
func GetTasksFuncAPI(w http.ResponseWriter, r *http.Request)
GetTasksFuncAPI fetches tasks depending on the request, the authorization will be taken care by our middleare in this function we will return all the tasks to the user or tasks per category GET /api/get-tasks/
func GetTokenHandler ¶
func GetTokenHandler(w http.ResponseWriter, r *http.Request)
GetTokenHandler will get a token for the username and password
func LoginFunc ¶
func LoginFunc(w http.ResponseWriter, r *http.Request)
LoginFunc implements the login functionality, will add a cookie to the cookie store for managing authentication
func LogoutFunc ¶
func LogoutFunc(w http.ResponseWriter, r *http.Request)
LogoutFunc Implements the logout functionality. WIll delete the session information from the cookie store
func PopulateTemplates ¶
func PopulateTemplates()
PopulateTemplates is used to parse all templates present in the templates folder
func RequiresLogin ¶
func RequiresLogin(handler func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)
RequiresLogin is a middleware which will be used for each httpHandler to check if there is any active session
func RestoreFromCompleteFunc ¶
func RestoreFromCompleteFunc(w http.ResponseWriter, r *http.Request)
RestoreFromCompleteFunc restores the task from complete to pending
func RestoreTaskFunc ¶
func RestoreTaskFunc(w http.ResponseWriter, r *http.Request)
RestoreTaskFunc is used to restore task from trash, handles "/restore/" URL
func SearchTaskFunc ¶
func SearchTaskFunc(w http.ResponseWriter, r *http.Request)
SearchTaskFunc is used to handle the /search/ url, handles the search function
func ShowAllTasksFunc ¶
func ShowAllTasksFunc(w http.ResponseWriter, r *http.Request)
ShowAllTasksFunc is used to handle the "/" URL which is the default ons TODO add http404 error
func ShowCategoryFunc ¶
func ShowCategoryFunc(w http.ResponseWriter, r *http.Request)
ShowCategoryFunc will populate the /category/<id> URL which shows all the tasks related to that particular category
func ShowCompleteTasksFunc ¶
func ShowCompleteTasksFunc(w http.ResponseWriter, r *http.Request)
ShowCompleteTasksFunc is used to populate the "/completed/" URL
func ShowTrashTaskFunc ¶
func ShowTrashTaskFunc(w http.ResponseWriter, r *http.Request)
ShowTrashTaskFunc is used to handle the "/trash" URL which is used to show the deleted tasks
func SignUpFunc ¶
func SignUpFunc(w http.ResponseWriter, r *http.Request)
SignUpFunc will enable new users to sign up to our service
func TrashTaskFunc ¶
func TrashTaskFunc(w http.ResponseWriter, r *http.Request)
TrashTaskFunc is used to populate the trash tasks
func UpdateCategoryFunc ¶
func UpdateCategoryFunc(w http.ResponseWriter, r *http.Request)
UpdateCategoryFunc is used to update a task, handes "/upd-category/" URL
func UpdateCategoryFuncAPI ¶
func UpdateCategoryFuncAPI(w http.ResponseWriter, r *http.Request)
UpdateCategoryFuncAPI will update the category for the user
func UpdateTaskFunc ¶
func UpdateTaskFunc(w http.ResponseWriter, r *http.Request)
UpdateTaskFunc is used to update a task, handes "/update/" URL
func UpdateTaskFuncAPI ¶
func UpdateTaskFuncAPI(w http.ResponseWriter, r *http.Request)
UpdateTaskFuncAPI will add the tasks for the user
func UploadedFileHandler ¶
func UploadedFileHandler(w http.ResponseWriter, r *http.Request)
UploadedFileHandler is used to handle the uploaded file related requests
func ValidateToken ¶
ValidateToken will validate the token
Types ¶
type MyCustomClaims ¶
type MyCustomClaims struct { Username string `json:"username"` jwt.StandardClaims }