storage

package
v0.0.0-...-2d2cc06 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

package storage implements web file storage

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoDirKey is used by functions and middlewares along the /storage/upload route
	ErrNoDirKey           = errors.New("key 'target' not present on map r.MultipartForm.Value")
	ErrInvalidDirPath     = errors.New("the directory provided is invalid (regex failure)")
	ErrInvalidEntryPath   = errors.New("the entry provided is invalid (regex failure)")
	ErrInvalidFileName    = errors.New("the upload file name(s) are invalid (regex failure)")
	ErrWrongMethod        = errors.New("wrong method used to access endpoint in package 'storage'")
	ErrInvalidContentType = errors.New("invalid content type used to access endpoint in package 'storage'")
	ErrDeleteStorageDir   = errors.New("cannot delete user's storageDir")
	ErrUploadTooLarge     = errors.New("upload excceeds max allowable size")
)

Functions

func Delete

func Delete(w http.ResponseWriter, r *http.Request)

func Download

func Download(w http.ResponseWriter, r *http.Request)

func GetDirInfo

func GetDirInfo(w http.ResponseWriter, r *http.Request)

func InsertStorageDir

func InsertStorageDir(username, storageDir string) error

func Mkdir

func Mkdir(w http.ResponseWriter, r *http.Request)

func Move

func Move(w http.ResponseWriter, r *http.Request)

func ParseUploadData

func ParseUploadData(next http.Handler) http.Handler

func Rename

func Rename(w http.ResponseWriter, r *http.Request)

func SetDirToAbs

func SetDirToAbs(next http.Handler) http.Handler

func UpdateStorageDir

func UpdateStorageDir(username, storageDir string) error

func Upload

func Upload(w http.ResponseWriter, r *http.Request)

func ValidateDirPath

func ValidateDirPath(next http.Handler) http.Handler

func ValidateEntry

func ValidateEntry(next http.Handler) http.Handler

func ValidateEntryBaseLength

func ValidateEntryBaseLength(next http.Handler) http.Handler

func ValidateFileNames

func ValidateFileNames(next http.Handler) http.Handler

func ValidateTarget

func ValidateTarget(next http.Handler) http.Handler

func ValidateTargetBaseLength

func ValidateTargetBaseLength(next http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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