Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <[email protected]>
  • Loading branch information
vishr committed Apr 20, 2016
1 parent 2918b44 commit 1247552
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 30 deletions.
7 changes: 6 additions & 1 deletion echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}
Expand Down
12 changes: 6 additions & 6 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion middleware/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
12 changes: 6 additions & 6 deletions middleware/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
Expand Down
2 changes: 1 addition & 1 deletion middleware/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions middleware/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
Expand Down
2 changes: 1 addition & 1 deletion middleware/slash.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
Expand Down
4 changes: 2 additions & 2 deletions middleware/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
)
Expand Down

0 comments on commit 1247552

Please sign in to comment.