Skip to content

Commit 52fa135

Browse files
committed
Updated docs, exposed middleware.DefaultSkipper
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent aa483fd commit 52fa135

File tree

19 files changed

+50
-27
lines changed

19 files changed

+50
-27
lines changed

glide.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ package: github.com/labstack/echo
22
import:
33
- package: github.com/GeertJohan/go.rice
44
- package: github.com/dgrijalva/jwt-go
5+
- package: github.com/facebookgo/grace
6+
subpackages:
7+
- gracehttp
58
- package: github.com/gorilla/websocket
69
- package: github.com/labstack/gommon
710
subpackages:
811
- bytes
912
- color
1013
- log
1114
- random
12-
- package: github.com/mattn/go-isatty
15+
- package: github.com/tylerb/graceful
1316
- package: github.com/valyala/fasttemplate
1417
- package: golang.org/x/crypto
1518
subpackages:
@@ -21,7 +24,6 @@ import:
2124
- package: gopkg.in/mgo.v2
2225
subpackages:
2326
- bson
24-
- package: github.com/facebookgo/grace
2527
testImport:
2628
- package: github.com/stretchr/testify
2729
subpackages:

middleware/basic_auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const (
2828
var (
2929
// DefaultBasicAuthConfig is the default BasicAuth middleware config.
3030
DefaultBasicAuthConfig = BasicAuthConfig{
31-
Skipper: defaultSkipper,
31+
Skipper: DefaultSkipper,
3232
}
3333
)
3434

middleware/body_limit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type (
3232
var (
3333
// DefaultBodyLimitConfig is the default Gzip middleware config.
3434
DefaultBodyLimitConfig = BodyLimitConfig{
35-
Skipper: defaultSkipper,
35+
Skipper: DefaultSkipper,
3636
}
3737
)
3838

middleware/compress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const (
3636
var (
3737
// DefaultGzipConfig is the default Gzip middleware config.
3838
DefaultGzipConfig = GzipConfig{
39-
Skipper: defaultSkipper,
39+
Skipper: DefaultSkipper,
4040
Level: -1,
4141
}
4242
)

middleware/cors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type (
5050
var (
5151
// DefaultCORSConfig is the default CORS middleware config.
5252
DefaultCORSConfig = CORSConfig{
53-
Skipper: defaultSkipper,
53+
Skipper: DefaultSkipper,
5454
AllowOrigins: []string{"*"},
5555
AllowMethods: []string{echo.GET, echo.HEAD, echo.PUT, echo.PATCH, echo.POST, echo.DELETE},
5656
}

middleware/csrf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type (
6767
var (
6868
// DefaultCSRFConfig is the default CSRF middleware config.
6969
DefaultCSRFConfig = CSRFConfig{
70-
Skipper: defaultSkipper,
70+
Skipper: DefaultSkipper,
7171
TokenLength: 32,
7272
TokenLookup: "header:" + echo.HeaderXCSRFToken,
7373
ContextKey: "csrf",

middleware/jwt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const (
6060
var (
6161
// DefaultJWTConfig is the default JWT auth middleware config.
6262
DefaultJWTConfig = JWTConfig{
63-
Skipper: defaultSkipper,
63+
Skipper: DefaultSkipper,
6464
SigningMethod: AlgorithmHS256,
6565
ContextKey: "user",
6666
TokenLookup: "header:" + echo.HeaderAuthorization,

middleware/key_auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type (
4040
var (
4141
// DefaultKeyAuthConfig is the default KeyAuth middleware config.
4242
DefaultKeyAuthConfig = KeyAuthConfig{
43-
Skipper: defaultSkipper,
43+
Skipper: DefaultSkipper,
4444
KeyLookup: "header:" + echo.HeaderAuthorization,
4545
AuthScheme: "Bearer",
4646
}

middleware/logger.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type (
3535
// - referer
3636
// - user_agent
3737
// - status
38-
// - latency (In microseconds)
38+
// - latency (In nanoseconds)
3939
// - latency_human (Human readable)
4040
// - bytes_in (Bytes received)
4141
// - bytes_out (Bytes sent)
@@ -61,7 +61,7 @@ type (
6161
var (
6262
// DefaultLoggerConfig is the default Logger middleware config.
6363
DefaultLoggerConfig = LoggerConfig{
64-
Skipper: defaultSkipper,
64+
Skipper: DefaultSkipper,
6565
Format: `{"time":"${time_rfc3339_nano}","remote_ip":"${remote_ip}","host":"${host}",` +
6666
`"method":"${method}","uri":"${uri}","status":${status}, "latency":${latency},` +
6767
`"latency_human":"${latency_human}","bytes_in":${bytes_in},` +
@@ -157,8 +157,8 @@ func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc {
157157
}
158158
return buf.WriteString(s)
159159
case "latency":
160-
l := stop.Sub(start).Nanoseconds() / int64(time.Microsecond)
161-
return buf.WriteString(strconv.FormatInt(l, 10))
160+
l := stop.Sub(start)
161+
return buf.WriteString(strconv.FormatInt(int64(l), 10))
162162
case "latency_human":
163163
return buf.WriteString(stop.Sub(start).String())
164164
case "bytes_in":

0 commit comments

Comments
 (0)