1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-04-20 07:32:51 -07:00
parent 2918b44698
commit 1247552c9b
9 changed files with 35 additions and 30 deletions

View File

@ -329,8 +329,13 @@ func (e *Echo) Connect(path string, h HandlerFunc, m ...MiddlewareFunc) {
e.add(CONNECT, path, h, m...)
}
// Delete registers a new DELETE route for a path with matching handler in the router
// DELETE registers a new DELETE route for a path with matching handler in the router
// with optional route-level middleware.
func (e *Echo) DELETE(path string, h HandlerFunc, m ...MiddlewareFunc) {
e.add(DELETE, path, h, m...)
}
// Delete is deprecated, use `DELETE()` instead.
func (e *Echo) Delete(path string, h HandlerFunc, m ...MiddlewareFunc) {
e.add(DELETE, path, h, m...)
}

12
glide.lock generated
View File

@ -1,8 +1,8 @@
hash: 44dfc8aaffca5078e71afdb209a0ef0a359a35f69fb98c7b6a2fb87a5a70e757
updated: 2016-04-11T23:18:25.557463249-07:00
updated: 2016-04-20T07:32:00.358585738-07:00
imports:
- name: github.com/klauspost/compress
version: 9d711f4445beb7f6488148ce04e3b4dc6e72242d
version: 6ea72a38a8cdbe25966059c547d425e580c624a7
subpackages:
- flate
- gzip
@ -21,20 +21,20 @@ imports:
- name: github.com/mattn/go-isatty
version: 56b76bdf51f7708750eac80fa38b952bb9f32639
- name: github.com/stretchr/testify
version: 0744955171b0b6e1871ff9d7366abc2b7a7fcec0
version: c5d7a69bf8a2c9c374798160849c071093e41dd1
subpackages:
- assert
- name: github.com/valyala/fasthttp
version: cb7c08f920e1fc8a89ec1003b855f74c6aa6c427
version: 229698876475fef591fb04fabba5479fc3182291
- name: github.com/valyala/fasttemplate
version: 3b874956e03f1636d171bda64b130f9135f42cff
- name: golang.org/x/net
version: 589fda73dd0faec3dc59e7d7dab5b069e3fce0f9
version: fb93926129b8ec0056f2f458b1f519654814edf0
subpackages:
- context
- websocket
- name: golang.org/x/sys
version: 9eef40adf05b951699605195b829612bd7b69952
version: f64b50fbea64174967a8882830d621a18ee1548e
subpackages:
- unix
devImports: []

View File

@ -5,15 +5,15 @@ import "testing"
func TestGroup(t *testing.T) {
g := New().Group("/group")
h := func(Context) error { return nil }
g.Connect("/", h)
g.Delete("/", h)
g.Get("/", h)
g.Head("/", h)
g.Options("/", h)
g.Patch("/", h)
g.Post("/", h)
g.Put("/", h)
g.Trace("/", h)
g.CONNECT("/", h)
g.DELETE("/", h)
g.GET("/", h)
g.HEAD("/", h)
g.OPTIONS("/", h)
g.PATCH("/", h)
g.POST("/", h)
g.PUT("/", h)
g.TRACE("/", h)
g.Any("/", h)
g.Match([]string{GET, POST}, "/", h)
g.Static("/static", "/tmp")

View File

@ -16,7 +16,7 @@ type (
// GzipConfig defines the config for gzip middleware.
GzipConfig struct {
// Level is the gzip level.
// Optional with default value as -1.
// Optional, with default value as -1.
Level int
}

View File

@ -12,34 +12,34 @@ type (
// CORSConfig defines the config for CORS middleware.
CORSConfig struct {
// AllowOrigin defines a list of origins that may access the resource.
// Optional with default value as []string{"*"}.
// Optional, with default value as []string{"*"}.
AllowOrigins []string
// AllowMethods defines a list methods allowed when accessing the resource.
// This is used in response to a preflight request.
// Optional with default value as `DefaultCORSConfig.AllowMethods`.
// Optional, with default value as `DefaultCORSConfig.AllowMethods`.
AllowMethods []string
// AllowHeaders defines a list of request headers that can be used when
// making the actual request. This in response to a preflight request.
// Optional with default value as []string{}.
// Optional, with default value as []string{}.
AllowHeaders []string
// AllowCredentials indicates whether or not the response to the request
// can be exposed when the credentials flag is true. When used as part of
// a response to a preflight request, this indicates whether or not the
// actual request can be made using credentials.
// Optional with default value as false.
// Optional, with default value as false.
AllowCredentials bool
// ExposeHeaders defines a whitelist headers that clients are allowed to
// access.
// Optional with default value as []string{}.
// Optional, with default value as []string{}.
ExposeHeaders []string
// MaxAge indicates how long (in seconds) the results of a preflight request
// can be cached.
// Optional with default value as 0.
// Optional, with default value as 0.
MaxAge int
}
)

View File

@ -30,7 +30,7 @@ type (
//
// Example "${remote_id} ${status}"
//
// Optional with default value as `DefaultLoggerConfig.Format`.
// Optional, with default value as `DefaultLoggerConfig.Format`.
Format string
// Output is the writer where logs are written.

View File

@ -12,16 +12,16 @@ type (
// RecoverConfig defines the config for recover middleware.
RecoverConfig struct {
// StackSize is the stack size to be printed.
// Optional with default value as 4 KB.
// Optional, with default value as 4 KB.
StackSize int
// DisableStackAll disables formatting stack traces of all other goroutines
// into buffer after the trace for the current goroutine.
// Optional with default value as false.
// Optional, with default value as false.
DisableStackAll bool
// DisablePrintStack disables printing stack trace.
// Optional with default value as false.
// Optional, with default value as false.
DisablePrintStack bool
}
)

View File

@ -8,7 +8,7 @@ type (
// TrailingSlashConfig defines the config for TrailingSlash middleware.
TrailingSlashConfig struct {
// RedirectCode is the status code used when redirecting the request.
// Optional but when provided the request is redirected using this code.
// Optional, but when provided the request is redirected using this code.
RedirectCode int
}
)

View File

@ -18,11 +18,11 @@ type (
// Index is the list of index files to be searched and used when serving
// a directory.
// Optional with default value as []string{"index.html"}.
// Optional, with default value as []string{"index.html"}.
Index []string `json:"index"`
// Browse is a flag to enable/disable directory browsing.
// Optional with default value as false.
// Optional, with default value as false.
Browse bool `json:"browse"`
}
)