route

package
v0.0.0-...-138ac3e Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTaskHandler

func CreateTaskHandler(repo *repository.TaskRepository, writer http.ResponseWriter, request *http.Request)

CreateTaskHandler handles the Task creation request.

POST /tasks/

func DeleteTaskHandler

func DeleteTaskHandler(repo *repository.TaskRepository, writer http.ResponseWriter, request *http.Request, id int64)

DeleteTaskHandler handles the Task deletion request.

DELETE /tasks/:id

func GetTaskHandler

func GetTaskHandler(repo *repository.TaskRepository, writer http.ResponseWriter, request *http.Request, id int64)

GetTaskHandler handles the Task retreave request.

GET /tasks/:id

func ListTasksHandler

func ListTasksHandler(repo *repository.TaskRepository, writer http.ResponseWriter, request *http.Request)

ListTasksHandler handles the Task listing request.

GET /tasks/

func MakeJSONErrorResponse

func MakeJSONErrorResponse(writer http.ResponseWriter, status int, message string)

MakeJSONErrorResponse creates a error response with a message in JSON format.

func MakeJSONResponse

func MakeJSONResponse(writer http.ResponseWriter, status int, payload interface{})

MakeJSONResponse creates a response with a payload in JSON format.

func RootHandler

func RootHandler(writer http.ResponseWriter, request *http.Request)

RootHandler handles requests for the root address ("/") of the API.

GET /

func UpdateTaskHandler

func UpdateTaskHandler(repo *repository.TaskRepository, writer http.ResponseWriter, request *http.Request, id int64)

UpdateTaskHandler handles the Task update request.

PUT /tasks/:id

Types

This section is empty.

Jump to

Keyboard shortcuts

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