Documentation ¶
Overview ¶
Package storage provides functions to interact with the file storage
Index ¶
- Constants
- func CopyFile(src, dst *util.Path) error
- func CreateFile(pathData *util.Path) error
- func DeleteFile(fsPath string) error
- func FileExists(fsPath string) bool
- func GetFileInfo(fsPath string) (model.FileInfo, error)
- func GetFileMeta(fsPath string) model.FileMeta
- func GetFileReader(fsPath string) (*os.File, error)
- func GetInfo(fsPath string) (model.FileInfo, error)
- func MoveFile(src, dst *util.Path) error
- func RenameFile(oldPath, newPath string) error
- func UpdateFileMeta(fsPath string, fileMeta model.FileMeta) error
Constants ¶
const (
CachePrefix = "uploading:" // CachePrefix is the cache prefix for the file upload
)
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
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
CreateFile creates a new file at the provided path and updates the metadata
func DeleteFile ¶
DeleteFile deletes the file at the provided path
func FileExists ¶
FileExists returns true if the file at the provided path exists
func GetFileInfo ¶
GetFileInfo returns the file information for the file at the provided path, will auto add fileAppend to the path
func GetFileMeta ¶
GetFileMeta returns the file metadata for the file at the provided path
func GetFileReader ¶
GetFileReader returns a reader for the file at the provided path, need to close the file after use
func MoveFile ¶
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 ¶
RenameFile moves the file from the old path to the new 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 |