handlers

package
v0.0.0-...-e26ef75 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Files

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

Files is a handler for reading and writing files

func NewFiles

func NewFiles(s files.Storage, maxSize int64, l hclog.Logger) *Files

NewFiles creates a new File handler

func (*Files) SaveFileREST

func (f *Files) SaveFileREST(rw http.ResponseWriter, r *http.Request)

SaveFileREST saves the contents of the request to a file from the request

type Middleware

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

func NewMiddleware

func NewMiddleware(maxContentLength int64, logger hclog.Logger) *Middleware

NewMiddleware creates a new middleware handlers

func (*Middleware) CheckContentLengthMiddleware

func (mw *Middleware) CheckContentLengthMiddleware(next http.Handler) http.Handler

CheckContentLengthMiddleware ensures that the content length is not greater than our allowed max. This can not be 100% depended on as Content-Length might be reported incorrectly however it is a fast first pass check.

Jump to

Keyboard shortcuts

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