mirror of
https://github.com/labstack/echo.git
synced 2025-01-26 03:20:08 +02:00
Updated godoc
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
840e19dec1
commit
3a67c062de
@ -9,6 +9,7 @@ import (
|
|||||||
type (
|
type (
|
||||||
// BasicAuthConfig defines config for HTTP basic auth middleware.
|
// BasicAuthConfig defines config for HTTP basic auth middleware.
|
||||||
BasicAuthConfig struct {
|
BasicAuthConfig struct {
|
||||||
|
// AuthFunc is the function to validate basic auth credentials.
|
||||||
AuthFunc BasicAuthFunc
|
AuthFunc BasicAuthFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ type (
|
|||||||
var (
|
var (
|
||||||
// DefaultGzipConfig is the default gzip middleware config.
|
// DefaultGzipConfig is the default gzip middleware config.
|
||||||
DefaultGzipConfig = GzipConfig{
|
DefaultGzipConfig = GzipConfig{
|
||||||
Level: gzip.DefaultCompression,
|
Level: -1,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -31,10 +31,10 @@ type (
|
|||||||
// - response_size
|
// - response_size
|
||||||
//
|
//
|
||||||
// Example "${remote_id} ${status}"
|
// Example "${remote_id} ${status}"
|
||||||
Format string // Required
|
Format string
|
||||||
|
|
||||||
// Output is the writer where logs are written.
|
// Output is the writer where logs are written.
|
||||||
Output io.Writer // Required
|
Output io.Writer
|
||||||
|
|
||||||
template *fasttemplate.Template
|
template *fasttemplate.Template
|
||||||
color *color.Color
|
color *color.Color
|
||||||
|
@ -12,26 +12,27 @@ type (
|
|||||||
// StaticConfig defines config for static middleware.
|
// StaticConfig defines config for static middleware.
|
||||||
StaticConfig struct {
|
StaticConfig struct {
|
||||||
// Root is the directory from where the static content is served.
|
// Root is the directory from where the static content is served.
|
||||||
Root string `json:"root"` // Required
|
Root string `json:"root"`
|
||||||
|
|
||||||
// Index is the index file to be used while serving a directory.
|
// Index is the index file to be used while serving a directory.
|
||||||
// Default is `index.html`.
|
// Default is `index.html`.
|
||||||
Index string `json:"index"` // Optional
|
Index string `json:"index"`
|
||||||
|
|
||||||
// Browse is a flag to list directory or not.
|
// Browse is a flag to enable/disable directory browsing.
|
||||||
Browse bool `json:"browse"` // Optional
|
Browse bool `json:"browse"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// DefaultStaticConfig is the default static middleware config.
|
// DefaultStaticConfig is the default static middleware config.
|
||||||
DefaultStaticConfig = StaticConfig{
|
DefaultStaticConfig = StaticConfig{
|
||||||
|
Root: "",
|
||||||
Index: "index.html",
|
Index: "index.html",
|
||||||
Browse: false,
|
Browse: false,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Static returns a static middleware to deliever static content from the provided
|
// Static returns a static middleware to serves static content from the provided
|
||||||
// root directory.
|
// root directory.
|
||||||
func Static(root string) echo.MiddlewareFunc {
|
func Static(root string) echo.MiddlewareFunc {
|
||||||
c := DefaultStaticConfig
|
c := DefaultStaticConfig
|
||||||
|
Loading…
x
Reference in New Issue
Block a user