Documentation
¶
Index ¶
- Variables
- func AuthAdmin(userName, plainPassword, path string) (bool, error)
- func CheckPasswordHash(password, hash string) bool
- func CreateFolderZip(folder *models.Folder, basePath string, responseWriter gin.ResponseWriter) error
- func DeleteFiles(files []models.File) error
- func DeleteFolder(folderID uuid.UUID) error
- func GetAllFiles() []models.File
- func GetFileByID(id uuid.UUID) (*models.File, bool)
- func GetFolderContentByID(folderID uuid.UUID) ([]models.File, []models.Folder, error)
- func HasPinCode(file *models.File) bool
- func HashPassword(password string) (string, error)
- func SaveFile(filename string, diskPath string, pinCode string, folderID *uuid.UUID) error
- func SaveFolder(files []*multipart.FileHeader, pathsList []string, parentFolderID *uuid.UUID, ...) error
- func SaveUploadedFile(file *multipart.FileHeader, dstPath string) error
- func SaveUploadedFileAndCreateRecord(fileHeader *multipart.FileHeader, diskPath string, pinCode string, ...) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrUserNotFound = errors.New("user not found") ErrWrongPassword = errors.New("wrong password") )
Functions ¶
func CheckPasswordHash ¶
func CreateFolderZip ¶ added in v1.1.5
func DeleteFiles ¶
func DeleteFolder ¶
func GetAllFiles ¶
func GetFolderContentByID ¶
func HasPinCode ¶
func HashPassword ¶
func SaveFolder ¶
func SaveFolder(files []*multipart.FileHeader, pathsList []string, parentFolderID *uuid.UUID, pinCode string, displayName string) error
SaveFolder saves an entire folder structure with nested files and subfolders Parameters: - c: Gin context for accessing request data and multipart form - files: Array of file headers from the multipart form - pathsList: Array of relative paths corresponding to each file - parentFolderID: UUID of the parent folder where this structure will be created - pinCode: Optional PIN code for file protection Returns error if folder creation, file save, or database operations fail
func SaveUploadedFile ¶
func SaveUploadedFile(file *multipart.FileHeader, dstPath string) error
SaveUploadedFile writes the multipart upload to disk (atomic via temp file + rename).
func SaveUploadedFileAndCreateRecord ¶
func SaveUploadedFileAndCreateRecord(fileHeader *multipart.FileHeader, diskPath string, pinCode string, folderID *uuid.UUID, displayName string) error
SaveUploadedFileAndCreateRecord: 1) write to disk, 2) persist DB record, 3) cleanup disk file if DB step fails.
Types ¶
This section is empty.