views

package
v0.0.0-...-d9da739 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCategoryFuncAPI

func AddCategoryFuncAPI(w http.ResponseWriter, r *http.Request)

AddCategoryFuncAPI will add the category for the user

func AddCommentFuncAPI

func AddCommentFuncAPI(w http.ResponseWriter, r *http.Request)

AddCommentFuncAPI handles the PUT /comment/ and adds a new comment to the database. Each comment has a parent task, comments can't be parents of comments. Returns a JSON {http status code, output} like {400, "Unable to add comment"} or {200, "Comment Added"}. The status code is also written in the HTTP header of the response.

func AddTaskFuncAPI

func AddTaskFuncAPI(w http.ResponseWriter, r *http.Request)

AddTaskFuncAPI will add the tasks for the user

func CompleteTaskFuncAPI

func CompleteTaskFuncAPI(w http.ResponseWriter, r *http.Request)

CompleteTaskFuncAPI will delete a task which is passed as an ID

func DeleteCategoryFuncAPI

func DeleteCategoryFuncAPI(w http.ResponseWriter, r *http.Request)

DeleteCategoryFuncAPI will delete the category for the user

func DeleteCommentFuncAPI

func DeleteCommentFuncAPI(w http.ResponseWriter, r *http.Request)

DeleteCommentFuncAPI handles the DELETE /comment/12 and deletes a comment with ID 12. Returns a JSON {http status code, output} like {400, "Not Deleted"} or {200, "Comment deleted"}. The status code is also written in the HTTP header of the response.

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 as a JSON.

func GetCompletedTaskFuncAPI

func GetCompletedTaskFuncAPI(w http.ResponseWriter, r *http.Request)

GetCompletedTaskFuncAPI will get the deleted tasks for 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 /tasks/

func Home

func Home(w http.ResponseWriter, r *http.Request)

Home renders the basic html page to the Vue front end, the Vue front end will then update the html content according to the user interactions by making AJAX calls we have used Go language's templating mechanism to split templates into logical parts

func LoginFuncAPI

func LoginFuncAPI(w http.ResponseWriter, r *http.Request)

LoginFuncAPI implements the login functionality, will add a cookie to the cookie store for managing authentication

func LogoutFuncAPI

func LogoutFuncAPI(w http.ResponseWriter, r *http.Request)

LogoutFuncAPI Implements the logout functionality. WIll delete the session information from the cookie store

func PopulateTemplates

func PopulateTemplates()

PopulateTemplates parses all templates present in the templates folder and returns a pointer in templates we use templates variable to locate other templates

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 RestoreFromCompleteFuncAPI

func RestoreFromCompleteFuncAPI(w http.ResponseWriter, r *http.Request)

RestoreFromCompleteFuncAPI handles the GET /incomplete-task/ and restores the status of task from complete to pending. Returns a JSON {http status code, output} like {400, "Not Deleted"} or {200, "Comment deleted"}. The status code is also written in the HTTP header of the response.

func RestoreTaskFuncAPI

func RestoreTaskFuncAPI(w http.ResponseWriter, r *http.Request)

func ShowCategoryFuncAPI

func ShowCategoryFuncAPI(w http.ResponseWriter, r *http.Request)

ShowCategoryFuncAPI will return all the tasks of a particular category we will be returning a status internal server error in case we do not find the tasks of that category, the url it will handle is GET /categories/<value>; if value is nil it'll return a JSON error

func SignUpFuncAPI

func SignUpFuncAPI(w http.ResponseWriter, r *http.Request)

SignUpFuncAPI will enable new users to sign up to our service

func TrashTaskFuncAPI

func TrashTaskFuncAPI(w http.ResponseWriter, r *http.Request)

TrashTaskFuncAPI handles the GET /trash-task/ and trashes the ID passed in the URL. return JSON {http status code, output of operation}.

func UpdateCategoryFuncAPI

func UpdateCategoryFuncAPI(w http.ResponseWriter, r *http.Request)

UpdateCategoryFuncAPI will update the category for the user

func UpdateTaskFuncAPI

func UpdateTaskFuncAPI(w http.ResponseWriter, r *http.Request)

UpdateTaskFuncAPI will add the tasks for the user

Types

This section is empty.

Jump to

Keyboard shortcuts

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