MCPcopy Create free account
hub / github.com/dionysia-dev/dionysia / EnqueuePackaging

Method EnqueuePackaging

internal/api/controller.go:189–210  ·  view source on GitHub ↗

@Summary Enqueue packacing job @Description Enqueue packaging job using input URL, format and ID @Produce json @Param id query string true "Input ID" @Success 201 {object} api.SuccessResponse @Failure 400 {object} api.ErrorResponse "Invalid UUID format" @Failure 500 {object} api.ErrorResponse "Inter

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

187// @Failure 500 {object} api.ErrorResponse "Internal server error"
188// @Router /notifications/package [post]
189func (n *NotificationController) EnqueuePackaging(ctx *gin.Context) {
190 id, err := uuid.Parse(ctx.Query("id"))
191 if err != nil {
192 ctx.JSON(http.StatusBadRequest, ErrorResponse{
193 Error: Error{Message: "Invalid UUID format"},
194 })
195
196 return
197 }
198
199 if err := n.notificationHandler.PackageStream(ctx, id); err != nil {
200 ctx.JSON(http.StatusInternalServerError, ErrorResponse{
201 Error: Error{Message: "InternalServerError: while creating input"},
202 })
203
204 return
205 }
206
207 ctx.JSON(http.StatusCreated, SuccessResponse{
208 Message: "Packaging job enqueued successfully",
209 })
210}
211
212func NewOriginController(oh service.OriginHandler) *OriginController {
213 return &OriginController{originHandler: oh}

Callers

nothing calls this directly

Calls 1

PackageStreamMethod · 0.65

Tested by

no test coverage detected