handler

package
v0.0.0-...-caf4afc Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestHandler

type RequestHandler struct {
	// contains filtered or unexported fields
}

func NewRequestHandler

func NewRequestHandler(taskService service.TaskService) *RequestHandler

func (*RequestHandler) CreateTaskHandler

func (h *RequestHandler) CreateTaskHandler(w http.ResponseWriter, r *http.Request)

CreateTaskHandler godoc @Summary Create a new task @Description Create a new task and send it to the queue @Tags tasks @Accept json @Produce json @Param task body model.TaskRequest true "Task name" @Success 200 {object} model.TaskResponse @Failure 502 {object} response.ErrorResponse "Failed to send command" @Router /task [post]

func (*RequestHandler) DeleteTaskHandler

func (h *RequestHandler) DeleteTaskHandler(w http.ResponseWriter, r *http.Request)

DeleteTaskHandler godoc @Summary Delete task @Description Delete existing task @Tags tasks @Produce json @Param id path string true "Task ID" @Failure 400 {object} response.ErrorResponse "Wrong id param" @Failure 502 {object} response.ErrorResponse "Failed to send command" @Router /task/{id} [delete]

func (*RequestHandler) HealthHandler

func (h *RequestHandler) HealthHandler(w http.ResponseWriter, r *http.Request)

func (*RequestHandler) UpdateTaskHandler

func (h *RequestHandler) UpdateTaskHandler(w http.ResponseWriter, r *http.Request)

UpdateTaskHandler godoc @Summary Update task @Description Change status of existing task @Tags tasks @Produce json @Param id path string true "Task ID" @Param complete query string true "Complete task. Possible values: true/false" @Failure 400 {object} response.ErrorResponse "Wrong id or completed param" @Failure 502 {object} response.ErrorResponse "Failed to send command" @Router /task/{id} [put]

Jump to

Keyboard shortcuts

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