Documentation ¶
Index ¶
- Constants
- type Handler
- func (h *Handler) Delete(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handler) Get(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handler) GetByIDs(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handler) Post(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handler) PostMultiple(ctx context.Context, w http.ResponseWriter, r *http.Request) error
Constants ¶
const BasePath = "/media"
const DeletePath = v1.Version + BasePath + "/{" + MediaID + "}"
const GetByIDsPath = v1.Version + BasePath
const GetPath = v1.Version + BasePath + "/{" + MediaID + "}"
const MediaID = "mediaID"
const PostMultiple = v1.Version + BasePath + "/many"
const PostPath = v1.Version + BasePath
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) Delete ¶
Delete handles the deletion of a media file by its ID. @Summary Delete a media file @Description Delete a media file by its ID @Tags media @Param media_id path string true "Media ID" @Success 204 @Failure 404 {object} v1.ErrorResponse @Failure 500 {object} v1.ErrorResponse @Router /v1/media/{media_id} [delete]
func (*Handler) Get ¶
Get handles the retrieval of a media file by its ID. @Summary Get a media file @Description Retrieve a media file by its ID @Tags media @Produce application/json @Param media_id path string true "Media ID" @Success 200 {object} media.Media @Failure 404 {object} v1.ErrorResponse @Failure 500 {object} v1.ErrorResponse @Router /v1/media/{media_id} [get]
func (*Handler) GetByIDs ¶
GetByIDs handles the retrieval of multiple media files by their IDs. @Summary Get multiple media files @Description Retrieve multiple media files by their IDs @Tags media @Accept application/json @Produce application/json @Param ids body []string true "Array of Media IDs" @Success 200 {array} media.Media @Failure 400 {object} v1.ErrorResponse @Failure 500 {object} v1.ErrorResponse @Router /v1/media [get]
func (*Handler) Post ¶
Post handles the uploading of a new media file. @Summary Upload a media file @Description Upload a new media file (image only) @Tags media @Accept multipart/form-data @Produce application/json @Param file formData file true "File to upload" @Success 201 {object} media.MediaData @Failure 400 {object} v1.ErrorResponse @Failure 500 {object} v1.ErrorResponse @Router /v1/media [post]
func (*Handler) PostMultiple ¶
Post handles the uploading of multiple new media files. @Summary Upload multiple media file @Description Upload a new media file (image only) @Tags media @Accept multipart/form-data @Produce application/json @Param file formData file true "File to upload" @Success 201 {object} []media.MediaData @Failure 400 {object} v1.ErrorResponse @Failure 500 {object} v1.ErrorResponse @Router /v1/media/many [post]