imagemanager

package
v0.0.0-...-27d469e Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyHandler

func CopyHandler(c *fiber.Ctx) error

CopyHandler handles copying images

func DeleteHandler

func DeleteHandler(c *fiber.Ctx) error

DeleteHandler handles image deletion

func InfoHandler

func InfoHandler(c *fiber.Ctx) error

InfoHandler returns detailed information about an image

func InitService

func InitService()

func ListHandler

func ListHandler(c *fiber.Ctx) error

ListHandler handles the request to list images

func MoveHandler

func MoveHandler(c *fiber.Ctx) error

MoveHandler handles moving images

func RenameHandler

func RenameHandler(c *fiber.Ctx) error

RenameHandler handles image renaming

func ThumbnailHandler

func ThumbnailHandler(c *fiber.Ctx) error

ThumbnailHandler serves image thumbnails

func UploadHandler

func UploadHandler(c *fiber.Ctx) error

UploadHandler handles image upload requests

func ViewHandler

func ViewHandler(c *fiber.Ctx) error

ViewHandler serves the original image

Types

type ImageInfo

type ImageInfo struct {
	Name      string    `json:"name"`
	Path      string    `json:"path"`
	Size      int64     `json:"size"`
	Width     int       `json:"width"`
	Height    int       `json:"height"`
	Format    string    `json:"format"`
	ModTime   time.Time `json:"mod_time"`
	Extension string    `json:"extension"`
}

type ImagemanagerService

type ImagemanagerService struct {
	// contains filtered or unexported fields
}

func GetService

func GetService() *ImagemanagerService

func (*ImagemanagerService) Copy

func (s *ImagemanagerService) Copy(sourcePath, destPath string) error

Copy copies an image and its thumbnail to a new location

func (*ImagemanagerService) Delete

func (s *ImagemanagerService) Delete(path string) error

Delete removes an image and its thumbnail

func (*ImagemanagerService) GetInfo

func (s *ImagemanagerService) GetInfo(path string) (*ImageInfo, error)

GetInfo returns detailed information about an image

func (*ImagemanagerService) GetThumbnail

func (s *ImagemanagerService) GetThumbnail(path string) (string, error)

GetThumbnail returns a thumbnail of the image

func (*ImagemanagerService) List

func (s *ImagemanagerService) List(path string) ([]ImageInfo, error)

List returns a list of images in the specified path

func (*ImagemanagerService) Move

func (s *ImagemanagerService) Move(sourcePath, destPath string) error

Move moves an image and its thumbnail to a new location

func (*ImagemanagerService) Rename

func (s *ImagemanagerService) Rename(oldPath, newPath string) error

Rename renames an image and its thumbnail

func (*ImagemanagerService) Upload

func (s *ImagemanagerService) Upload(path string, file io.Reader, filename string) error

Upload handles image upload to the specified path

Jump to

Keyboard shortcuts

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