Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateTaskDTO ¶
type CreateTaskDTO struct {
Repo string
}
type CreateTaskResponse ¶
type CreateTaskResponse struct { TaskID uint `json:"taskID"` Status models.TaskStatus `json:"status"` }
func (*CreateTaskResponse) Render ¶
func (c *CreateTaskResponse) Render(w http.ResponseWriter, r *http.Request) error
type TaskController ¶
type TaskController struct {
// contains filtered or unexported fields
}
func New ¶
func New(taskService TaskService) *TaskController
func (*TaskController) Create ¶
func (c *TaskController) Create(w http.ResponseWriter, r *http.Request)
Create a new task
@Summary Create a new task @Description Create a new task for a specific repository @Tags tasks @Security ApiKeyAuth @Accept json @Produce json @Param body body CreateTaskDTO true "Request body to create a task" @Success 201 {object} CreateTaskResponse @Failure 400 {object} errors.ErrResponse "Invalid JSON or missing required fields" @Failure 500 {object} errors.ErrResponse "Internal server error" @Router /tasks [post]
func (*TaskController) Upload ¶
func (c *TaskController) Upload(w http.ResponseWriter, r *http.Request)
Upload handles file uploads for a specific task.
@Summary Upload files to a task @Description Upload multiple files associated with a specific task ID. Each file must be less than 10MB. @Tags tasks @Security ApiKeyAuth @Accept multipart/form-data @Produce json @Param taskID path string true "Task ID" @Param files formData file true "Files to upload" @Success 200 {object} TaskUploadResponse "Successful file upload" @Failure 400 {object} errors.ErrResponse "Bad Request or File too large" @Failure 500 {object} errors.ErrResponse "Internal Server Error" @Router /tasks/{taskID}/upload [post]
type TaskService ¶
type TaskService interface { Create(repo string) (*models.Task, error) Upload(input *taskservice.TaskUploadInput) error }
type TaskUploadResponse ¶
func (*TaskUploadResponse) Render ¶
func (rd *TaskUploadResponse) Render(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.