From 3a67c062deb4e03e3450d220fd64ea6eec3ba8ed Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Wed, 23 Mar 2016 22:56:28 -0500 Subject: [PATCH] Updated godoc Signed-off-by: Vishal Rana --- middleware/auth.go | 1 + middleware/compress.go | 2 +- middleware/logger.go | 4 ++-- middleware/static.go | 11 ++++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/middleware/auth.go b/middleware/auth.go index cbfb4c2d..4cc1920e 100644 --- a/middleware/auth.go +++ b/middleware/auth.go @@ -9,6 +9,7 @@ import ( type ( // BasicAuthConfig defines config for HTTP basic auth middleware. BasicAuthConfig struct { + // AuthFunc is the function to validate basic auth credentials. AuthFunc BasicAuthFunc } diff --git a/middleware/compress.go b/middleware/compress.go index e836df07..8bdb0e8d 100644 --- a/middleware/compress.go +++ b/middleware/compress.go @@ -28,7 +28,7 @@ type ( var ( // DefaultGzipConfig is the default gzip middleware config. DefaultGzipConfig = GzipConfig{ - Level: gzip.DefaultCompression, + Level: -1, } ) diff --git a/middleware/logger.go b/middleware/logger.go index df09e4dd..1343400e 100644 --- a/middleware/logger.go +++ b/middleware/logger.go @@ -31,10 +31,10 @@ type ( // - response_size // // Example "${remote_id} ${status}" - Format string // Required + Format string // Output is the writer where logs are written. - Output io.Writer // Required + Output io.Writer template *fasttemplate.Template color *color.Color diff --git a/middleware/static.go b/middleware/static.go index e28aadcd..b7d8e30f 100644 --- a/middleware/static.go +++ b/middleware/static.go @@ -12,26 +12,27 @@ type ( // StaticConfig defines config for static middleware. StaticConfig struct { // 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. // Default is `index.html`. - Index string `json:"index"` // Optional + Index string `json:"index"` - // Browse is a flag to list directory or not. - Browse bool `json:"browse"` // Optional + // Browse is a flag to enable/disable directory browsing. + Browse bool `json:"browse"` } ) var ( // DefaultStaticConfig is the default static middleware config. DefaultStaticConfig = StaticConfig{ + Root: "", Index: "index.html", 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. func Static(root string) echo.MiddlewareFunc { c := DefaultStaticConfig