filemanager

package
v0.0.0-...-118bb3a Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 10 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 files and directories

func CreateHandler

func CreateHandler(c *fiber.Ctx) error

CreateHandler handles the creation of new files and directories

func DeleteHandler

func DeleteHandler(c *fiber.Ctx) error

DeleteHandler handles file and directory deletion

func DownloadHandler

func DownloadHandler(c *fiber.Ctx) error

DownloadHandler handles file downloads

func InfoHandler

func InfoHandler(c *fiber.Ctx) error

InfoHandler returns detailed information about a file or directory

func InitService

func InitService()

func ListHandler

func ListHandler(c *fiber.Ctx) error

ListHandler handles the request to list files and directories

func MoveHandler

func MoveHandler(c *fiber.Ctx) error

MoveHandler handles moving files and directories

func RenameHandler

func RenameHandler(c *fiber.Ctx) error

RenameHandler handles file and directory renaming

func UploadHandler

func UploadHandler(c *fiber.Ctx) error

UploadHandler handles file upload requests

Types

type FileInfo

type FileInfo struct {
	Name      string    `json:"name"`
	Path      string    `json:"path"`
	Size      int64     `json:"size"`
	IsDir     bool      `json:"is_dir"`
	Mode      string    `json:"mode"`
	ModTime   time.Time `json:"mod_time"`
	Extension string    `json:"extension"`
}

type FilemanagerService

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

func GetService

func GetService() *FilemanagerService

func (*FilemanagerService) Copy

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

Copy copies a file or directory to a new location

func (*FilemanagerService) Create

func (s *FilemanagerService) Create(path string, isDir bool) error

Create creates a new directory or file

func (*FilemanagerService) Delete

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

Delete removes a file or directory

func (*FilemanagerService) GetInfo

func (s *FilemanagerService) GetInfo(path string) (*FileInfo, error)

GetInfo returns detailed information about a file or directory

func (*FilemanagerService) List

func (s *FilemanagerService) List(path string) ([]FileInfo, error)

List returns a list of files and directories in the specified path

func (*FilemanagerService) Move

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

Move moves a file or directory to a new location

func (*FilemanagerService) Rename

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

Rename renames a file or directory

func (*FilemanagerService) Upload

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

Upload handles file upload to the specified path

Jump to

Keyboard shortcuts

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