files

package
v0.0.0-...-9818b01 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: AGPL-3.0 Imports: 16 Imported by: 0

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

View Source
const TagSeparator = ","

TagSeparator is the character separating tags

Variables

View Source
var ErrDocTypeInvalid = errors.New("Invalid document type")

ErrDocTypeInvalid is used when the document type sent is not recognized

Functions

func AddReferencedHandler

func AddReferencedHandler(c echo.Context) error

AddReferencedHandler is the echo.handler for adding referenced_by to a file POST /files/:file-id/relationships/referenced_by

func ArchiveDownloadCreateHandler

func ArchiveDownloadCreateHandler(c echo.Context) error

ArchiveDownloadCreateHandler handles requests to /files/archive and stores the paremeters with a secret to be used in download handler below.s

func ArchiveDownloadHandler

func ArchiveDownloadHandler(c echo.Context) error

ArchiveDownloadHandler handles requests to /files/archive/:secret/whatever.zip and creates on the fly zip archive from the parameters linked to secret.

func ClearTrashHandler

func ClearTrashHandler(c echo.Context) error

ClearTrashHandler handles DELETE request to clear the trash

func CreationHandler

func CreationHandler(c echo.Context) error

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

func DestroyFileHandler(c echo.Context) error

DestroyFileHandler handles DELETE request to clear one element from the trash

func FileDownloadCreateHandler

func FileDownloadCreateHandler(c echo.Context) error

FileDownloadCreateHandler stores the required path into a secret usable for download handler below.

func FileDownloadHandler

func FileDownloadHandler(c echo.Context) error

FileDownloadHandler send a file that have previously be defined through FileDownloadCreateHandler

func ModifyMetadataByIDHandler

func ModifyMetadataByIDHandler(c echo.Context) error

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

func ModifyMetadataByPathHandler(c echo.Context) error

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

func OverwriteFileContentHandler(c echo.Context) (err error)

OverwriteFileContentHandler handles PUT requests on /files/:file-id to overwrite the content of a file given its identifier.

func ReadFileContentFromIDHandler

func ReadFileContentFromIDHandler(c echo.Context) error

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

func ReadFileContentFromPathHandler(c echo.Context) error

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

func ReadMetadataFromIDHandler(c echo.Context) error

ReadMetadataFromIDHandler handles all GET requests on /files/:file- id aiming at getting file metadata from its path.

func ReadMetadataFromPathHandler

func ReadMetadataFromPathHandler(c echo.Context) error

ReadMetadataFromPathHandler handles all GET requests on /files/metadata aiming at getting file metadata from its path.

func ReadTrashFilesHandler

func ReadTrashFilesHandler(c echo.Context) error

ReadTrashFilesHandler handle GET requests on /files/trash and return the list of trashed files and directories

func RestoreTrashFileHandler

func RestoreTrashFileHandler(c echo.Context) error

RestoreTrashFileHandler handle POST requests on /files/trash/file-id and can be used to restore a file or directory from the trash.

func Routes

func Routes(router *echo.Group)

Routes sets the routing for the files service

func TrashHandler

func TrashHandler(c echo.Context) error

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.

Jump to

Keyboard shortcuts

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