mediagrp

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BasePath = "/media"
View Source
const DeletePath = v1.Version + BasePath + "/{" + MediaID + "}"
View Source
const GetByIDsPath = v1.Version + BasePath
View Source
const GetPath = v1.Version + BasePath + "/{" + MediaID + "}"
View Source
const MediaID = "mediaID"
View Source
const PostMultiple = v1.Version + BasePath + "/many"
View Source
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 New

func New(media *media.Core) *Handler

func (*Handler) Delete

func (h *Handler) Delete(ctx context.Context, w http.ResponseWriter, r *http.Request) error

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

func (h *Handler) GetByIDs(ctx context.Context, w http.ResponseWriter, r *http.Request) error

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

func (h *Handler) PostMultiple(ctx context.Context, w http.ResponseWriter, r *http.Request) error

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]

Jump to

Keyboard shortcuts

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