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: 11 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(rpcClient client.Client) *RequestHandler

func (*RequestHandler) GetTaskHandler

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

GetTaskHandler godoc @Summary Get task @Description Fetch task by id @Tags tasks @Produce json @Param id path string true "Task ID" @Success 200 {object} data.Task "Task with latest status" @Failure 400 {object} response.ErrorResponse "Wrong id param" @Failure 502 {object} response.ErrorResponse "Failed to read from store" @Router /task/{id} [get]

func (*RequestHandler) GetTaskHistoryHandler

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

GetTaskHistoryHandler godoc @Summary Get task history @Description Fetch task status update history by id @Tags tasks @Produce json @Param id path string true "Task ID" @Success 200 {object} data.TaskHistory "Task with status changes history" @Failure 400 {object} response.ErrorResponse "Missing id param" @Failure 502 {object} response.ErrorResponse "Failed to read from store" @Router /task/history/{id} [get]

func (*RequestHandler) GetTasksByStatusHandler

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

GetTasksByStatusHandler godoc @Summary Get tasks by status @Description Fetch tasks by specific status with offset and limit @Tags tasks @Produce json @Param status path string true "Task Status" @Param offset query string true "Offset - from which task to fetch" @Param limit query string true "Limit - how many tasks to fetch" @Success 200 {object} []data.Task "Tasks with specific status" @Failure 400 {object} response.ErrorResponse "Wrong path or query param" @Failure 502 {object} response.ErrorResponse "Failed to read from store" @Router /tasks/{status} [get]

Jump to

Keyboard shortcuts

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