package middleware
import "github.com/labstack/echo/middleware"
Index ¶
- func BasicAuth(fn BasicAuthFunc, options ...*BasicAuthOptions) echo.MiddlewareFunc
- func Favicon() echo.HandlerFunc
- func Gzip(options ...*GzipOptions) echo.MiddlewareFunc
- func Logger(options ...*LoggerOptions) echo.MiddlewareFunc
- func Recover(options ...*RecoverOptions) echo.MiddlewareFunc
- func Static(root string, options ...*StaticOptions) echo.MiddlewareFunc
- type BasicAuthFunc
- type BasicAuthOptions
- type GzipOptions
- type LoggerOptions
- type RecoverOptions
- type StaticOptions
Functions ¶
func BasicAuth ¶
func BasicAuth(fn BasicAuthFunc, options ...*BasicAuthOptions) echo.MiddlewareFunc
BasicAuth returns an HTTP basic authentication middleware.
For valid credentials it calls the next handler. For invalid credentials, it sends "401 - Unauthorized" response.
func Favicon ¶
func Favicon() echo.HandlerFunc
Favicon serves the default favicon - GET /favicon.ico.
func Gzip ¶
func Gzip(options ...*GzipOptions) echo.MiddlewareFunc
Gzip returns a middleware which compresses HTTP response using gzip compression scheme.
func Logger ¶
func Logger(options ...*LoggerOptions) echo.MiddlewareFunc
func Recover ¶
func Recover(options ...*RecoverOptions) echo.MiddlewareFunc
Recover returns a middleware which recovers from panics anywhere in the chain and handles the control to the centralized HTTPErrorHandler.
func Static ¶
func Static(root string, options ...*StaticOptions) echo.MiddlewareFunc
Types ¶
type BasicAuthFunc ¶
type BasicAuthOptions ¶
type BasicAuthOptions struct { }
type GzipOptions ¶
type GzipOptions struct {
// contains filtered or unexported fields
}
type LoggerOptions ¶
type LoggerOptions struct { }
type RecoverOptions ¶
type RecoverOptions struct { }
type StaticOptions ¶
type StaticOptions struct { Root string `json:"root"` Index string `json:"index"` Browse bool `json:"browse"` }
Source Files ¶
auth.go compress.go logger.go recover.go static.go
- Version
- v2.0.0-beta.1+incompatible
- Published
- Mar 11, 2016
- Platform
- linux/amd64
- Imports
- 17 packages
- Last checked
- 4 hours ago –
Tools for package owners.