storage

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package storage provides functions to interact with the file storage

Index

Constants

View Source
const (
	CachePrefix = "uploading:" // CachePrefix is the cache prefix for the file upload
)

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst *util.Path) error

CopyFile copies the whole folder of the source to the target and update the metadata src and dst are absolute path of file

func CreateFile added in v0.0.3

func CreateFile(pathData *util.Path) error

CreateFile creates a new file at the provided path and updates the metadata

func DeleteFile

func DeleteFile(fsPath string) error

DeleteFile deletes the file at the provided path

func FileExists

func FileExists(fsPath string) bool

FileExists returns true if the file at the provided path exists

func GetFileInfo

func GetFileInfo(fsPath string) (model.FileInfo, error)

GetFileInfo returns the file information for the file at the provided path, will auto add fileAppend to the path

func GetFileMeta

func GetFileMeta(fsPath string) model.FileMeta

GetFileMeta returns the file metadata for the file at the provided path

func GetFileReader

func GetFileReader(fsPath string) (*os.File, error)

GetFileReader returns a reader for the file at the provided path, need to close the file after use

func GetInfo

func GetInfo(fsPath string) (model.FileInfo, error)

GetInfo returns the file information for the file at the provided path

func MoveFile

func MoveFile(src, dst *util.Path) error

MoveFile moves the whole folder of the source to the target and update the metadata src and dst are absolute path of file

func RenameFile

func RenameFile(oldPath, newPath string) error

RenameFile moves the file from the old path to the new path

func UpdateFileMeta

func UpdateFileMeta(fsPath string, fileMeta model.FileMeta) error

UpdateFileMeta updates the file metadata for the file at the provided path

Types

This section is empty.

Directories

Path Synopsis
Package hasher provides a simple interface to hash files and update the hash of the file in the database.
Package hasher provides a simple interface to hash files and update the hash of the file in the database.
Package image provides image processing functions for the application.
Package image provides image processing functions for the application.
Package model provides the data models for the application.
Package model provides the data models for the application.
Package upload provides functions for uploading files to the server
Package upload provides functions for uploading files to the server

Jump to

Keyboard shortcuts

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