Documentation ¶
Index ¶
- func CreateTaskHandler(repo *repository.TaskRepository, writer http.ResponseWriter, ...)
- func DeleteTaskHandler(repo *repository.TaskRepository, writer http.ResponseWriter, ...)
- func GetTaskHandler(repo *repository.TaskRepository, writer http.ResponseWriter, ...)
- func ListTasksHandler(repo *repository.TaskRepository, writer http.ResponseWriter, ...)
- func MakeJSONErrorResponse(writer http.ResponseWriter, status int, message string)
- func MakeJSONResponse(writer http.ResponseWriter, status int, payload interface{})
- func RootHandler(writer http.ResponseWriter, request *http.Request)
- func UpdateTaskHandler(repo *repository.TaskRepository, writer http.ResponseWriter, ...)
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.
Click to show internal directories.
Click to hide internal directories.