Documentation
¶
Overview ¶
Package files is the HTTP frontend of the vfs package. It exposes an HTTP api to manipulate the filesystem and offer all the possibilities given by the vfs.
Index ¶
- Constants
- Variables
- func AddReferencedHandler(c echo.Context) error
- func ArchiveDownloadCreateHandler(c echo.Context) error
- func ArchiveDownloadHandler(c echo.Context) error
- func ClearTrashHandler(c echo.Context) error
- func CreationHandler(c echo.Context) error
- func DestroyFileHandler(c echo.Context) error
- func FileDownloadCreateHandler(c echo.Context) error
- func FileDownloadHandler(c echo.Context) error
- func ModifyMetadataByIDHandler(c echo.Context) error
- func ModifyMetadataByPathHandler(c echo.Context) error
- func OverwriteFileContentHandler(c echo.Context) (err error)
- func ReadFileContentFromIDHandler(c echo.Context) error
- func ReadFileContentFromPathHandler(c echo.Context) error
- func ReadMetadataFromIDHandler(c echo.Context) error
- func ReadMetadataFromPathHandler(c echo.Context) error
- func ReadTrashFilesHandler(c echo.Context) error
- func RestoreTrashFileHandler(c echo.Context) error
- func Routes(router *echo.Group)
- func TrashHandler(c echo.Context) error
Constants ¶
const TagSeparator = ","
TagSeparator is the character separating tags
Variables ¶
var ErrDocTypeInvalid = errors.New("Invalid document type")
ErrDocTypeInvalid is used when the document type sent is not recognized
Functions ¶
func AddReferencedHandler ¶
AddReferencedHandler is the echo.handler for adding referenced_by to a file POST /files/:file-id/relationships/referenced_by
func ArchiveDownloadCreateHandler ¶
ArchiveDownloadCreateHandler handles requests to /files/archive and stores the paremeters with a secret to be used in download handler below.s
func ArchiveDownloadHandler ¶
ArchiveDownloadHandler handles requests to /files/archive/:secret/whatever.zip and creates on the fly zip archive from the parameters linked to secret.
func ClearTrashHandler ¶
ClearTrashHandler handles DELETE request to clear the trash
func CreationHandler ¶
CreationHandler handle all POST requests on /files/:dir-id aiming at creating a new document in the FS. Given the Type parameter of the request, it will either upload a new file or create a new directory.
func DestroyFileHandler ¶
DestroyFileHandler handles DELETE request to clear one element from the trash
func FileDownloadCreateHandler ¶
FileDownloadCreateHandler stores the required path into a secret usable for download handler below.
func FileDownloadHandler ¶
FileDownloadHandler send a file that have previously be defined through FileDownloadCreateHandler
func ModifyMetadataByIDHandler ¶
ModifyMetadataByIDHandler handles PATCH requests on /files/:file-id
It can be used to modify the file or directory metadata, as well as moving and renaming it in the filesystem.
func ModifyMetadataByPathHandler ¶
ModifyMetadataByPathHandler handles PATCH requests on /files/:file-id
It can be used to modify the file or directory metadata, as well as moving and renaming it in the filesystem.
func OverwriteFileContentHandler ¶
OverwriteFileContentHandler handles PUT requests on /files/:file-id to overwrite the content of a file given its identifier.
func ReadFileContentFromIDHandler ¶
ReadFileContentFromIDHandler handles all GET requests on /files/:file-id aiming at downloading a file given its ID. It serves the file in inline mode.
func ReadFileContentFromPathHandler ¶
ReadFileContentFromPathHandler handles all GET request on /files/download aiming at downloading a file given its path. It serves the file in in attachment mode.
func ReadMetadataFromIDHandler ¶
ReadMetadataFromIDHandler handles all GET requests on /files/:file- id aiming at getting file metadata from its path.
func ReadMetadataFromPathHandler ¶
ReadMetadataFromPathHandler handles all GET requests on /files/metadata aiming at getting file metadata from its path.
func ReadTrashFilesHandler ¶
ReadTrashFilesHandler handle GET requests on /files/trash and return the list of trashed files and directories
func RestoreTrashFileHandler ¶
RestoreTrashFileHandler handle POST requests on /files/trash/file-id and can be used to restore a file or directory from the trash.
func TrashHandler ¶
TrashHandler handles all DELETE requests on /files/:file-id and moves the file or directory with the specified file-id to the trash.
Types ¶
This section is empty.