api

package
v0.0.0-...-410787f Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Example: X-FStorage-Hash-Control-MD5: abcdef...,
	XFSHashControlMD5       = "X-FStorage-Hash-Control-MD5"
	XFSHashControlSHA1      = "X-FStorage-Hash-Control-SHA1"
	XFSHashControlSHA256    = "X-FStorage-Hash-Control-SHA256"
	XFSHashControlSHA512    = "X-FStorage-Hash-Control-SHA512"
	XFSHashControlKeccak256 = "X-FStorage-Hash-Control-Keccak256"
	XFSHashControlKeccak512 = "X-FStorage-Hash-Control-Keccak512"
)

Variables

This section is empty.

Functions

func MiddlewareValidateFilename

func MiddlewareValidateFilename(next http.Handler) http.Handler

func MiddlewareValidateHash

func MiddlewareValidateHash(next http.Handler) http.Handler

func MiddlewareValidateHeadersControl

func MiddlewareValidateHeadersControl(next http.Handler) http.Handler

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(filestorage storage.Storage, filesizeLimit int64) *API

func (*API) DeleteFile

func (api *API) DeleteFile() http.HandlerFunc

func (*API) DownloadFile

func (api *API) DownloadFile() http.HandlerFunc

func (*API) UploadFile

func (api *API) UploadFile() http.HandlerFunc

type Error

type Error uint16
const (
	ErrInternalError Error = iota
	ErrEmptyFile
	ErrFileTransferFailure
	ErrInvalidFilename
	ErrFileNotFound
	ErrInvalidHeader
	ErrTheseHashesDoNotMatch
	ErrMaxSizeFileLimit
)

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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