Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageHandler ¶
type ImageHandler struct {
// contains filtered or unexported fields
}
func NewImageHandler ¶
func NewImageHandler(service *Service) *ImageHandler
func (*ImageHandler) UploadImage ¶
func (h *ImageHandler) UploadImage(c *gin.Context)
UploadImage godoc @Summary Upload an image @Description Uploads and processes an image, returning its URL @Tags Images @Accept multipart/form-data @Produce json @Param image formData file true "Image file to upload" @Success 200 {object} map[string]string "url" @Failure 400 {object} myerr.ErrorResponse "Bad Request (e.g., no file, invalid file type)" @Failure 500 {object} myerr.ErrorResponse "Internal Server Error" @Router /admin/images/upload [post]
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage implements Storage interface for local filesystem
func NewLocalStorage ¶
func NewLocalStorage(basePath, baseURL string) *LocalStorage
func (*LocalStorage) Delete ¶
func (s *LocalStorage) Delete(filename string) error
func (*LocalStorage) GetURL ¶
func (s *LocalStorage) GetURL(filename string) string
type ProcessConfig ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(storage Storage, config ProcessConfig) *Service
func (*Service) DeleteImage ¶
func (*Service) GetImageURL ¶
Click to show internal directories.
Click to hide internal directories.