handlers

package
v0.0.0-...-d378361 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLabelToTask

func AddLabelToTask(w http.ResponseWriter, req *http.Request)

Adds label to task. Query parameter: "task_id" - task id. Post body - label.

func AddTaskToProject

func AddTaskToProject(w http.ResponseWriter, req *http.Request)

Adds task to project Path param - "project_id" Post body - task Returns created task if OK

func AddUserToProject

func AddUserToProject(w http.ResponseWriter, req *http.Request)

func AllLabelsOnTask

func AllLabelsOnTask(w http.ResponseWriter, req *http.Request)

Returns all labels from task Path parameter: "task_id" - task id.

func AllProjects

func AllProjects(w http.ResponseWriter, _ *http.Request)

Returns all projects

func AllTasksInProject

func AllTasksInProject(w http.ResponseWriter, req *http.Request)

Returns all tasks Path param - "project_id"

func AllUsers

func AllUsers(w http.ResponseWriter, _ *http.Request)

Returns all users.

func CreateProject

func CreateProject(w http.ResponseWriter, req *http.Request)

Creates project Post body - project Returns created project if OK

func DeleteLabelFromTask

func DeleteLabelFromTask(w http.ResponseWriter, req *http.Request)

Deletes label from task and returns new labels Path parameter: "task_id" - task id. Post body - label

func DeleteUserFromProject

func DeleteUserFromProject(w http.ResponseWriter, req *http.Request)

func GetAllProjectsFromUser

func GetAllProjectsFromUser(w http.ResponseWriter, req *http.Request)

Returns all projects of given user

func GetAllTasksFromProject

func GetAllTasksFromProject(w http.ResponseWriter, req *http.Request)

func GetAllUsersFromProject

func GetAllUsersFromProject(w http.ResponseWriter, req *http.Request)

func GetProjectById

func GetProjectById(w http.ResponseWriter, req *http.Request)

Returns project with given id Query param: "id" - project id

func GetTaskById

func GetTaskById(w http.ResponseWriter, req *http.Request)

Returns task with given id Path params: "id" - task id.

func GetUserById

func GetUserById(w http.ResponseWriter, req *http.Request)

Returns user with given id. Path param: "id" - user id.

func JsonErrorResponse

func JsonErrorResponse(w http.ResponseWriter, err error, code int)

Writes json formatted error.

func JsonNullHandler

func JsonNullHandler(w http.ResponseWriter, _ *http.Request)

Sets content type json and status OK

func JsonResponse

func JsonResponse(w http.ResponseWriter, response interface{})

Writes json formatted response.

func Login

func Login(w http.ResponseWriter, req *http.Request)

Authorizes user in system. Post body - credentials in format: {"email": "...", "password": "..."} Returns token for authentication.

func RegisterUser

func RegisterUser(w http.ResponseWriter, req *http.Request)

Registers user Post body - user credentials in format: {"email": "...", "password": "..."} Returns credentials if OK

Types

This section is empty.

Jump to

Keyboard shortcuts

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