mirror of https://github.com/gofiber/fiber.git
Fix some consts
parent
b425a5b4bf
commit
c5436a7519
18
app.go
18
app.go
|
@ -175,55 +175,55 @@ func (app *App) Use(args ...interface{}) *App {
|
|||
|
||||
// Connect : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Connect(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodConnect, path, handlers...)
|
||||
app.registerMethod(MethodConnect, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
// Put : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Put(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodPut, path, handlers...)
|
||||
app.registerMethod(MethodPut, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
// Post : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Post(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodPost, path, handlers...)
|
||||
app.registerMethod(MethodPost, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
// Delete : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Delete(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodDelete, path, handlers...)
|
||||
app.registerMethod(MethodDelete, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
// Head : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Head(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodHead, path, handlers...)
|
||||
app.registerMethod(MethodHead, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
// Patch : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Patch(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodPatch, path, handlers...)
|
||||
app.registerMethod(MethodPatch, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
// Options : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Options(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodOptions, path, handlers...)
|
||||
app.registerMethod(MethodOptions, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
// Trace : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Trace(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodTrace, path, handlers...)
|
||||
app.registerMethod(MethodTrace, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
// Get : https://fiber.wiki/application#http-methods
|
||||
func (app *App) Get(path string, handlers ...func(*Ctx)) *App {
|
||||
app.registerMethod(fasthttp.MethodGet, path, handlers...)
|
||||
app.registerMethod(MethodGet, path, handlers...)
|
||||
return app
|
||||
}
|
||||
|
||||
|
|
20
group.go
20
group.go
|
@ -6,8 +6,6 @@ package fiber
|
|||
|
||||
import (
|
||||
"log"
|
||||
|
||||
fasthttp "github.com/valyala/fasthttp"
|
||||
)
|
||||
|
||||
// Group ...
|
||||
|
@ -62,55 +60,55 @@ func (grp *Group) Use(args ...interface{}) *Group {
|
|||
|
||||
// Connect : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Connect(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodConnect, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodConnect, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
// Put : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Put(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodPut, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodPut, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
// Post : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Post(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodPost, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodPost, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
// Delete : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Delete(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodDelete, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodDelete, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
// Head : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Head(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodHead, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodHead, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
// Patch : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Patch(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodPatch, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodPatch, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
// Options : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Options(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodOptions, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodOptions, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
// Trace : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Trace(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodTrace, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodTrace, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
// Get : https://fiber.wiki/application#http-methods
|
||||
func (grp *Group) Get(path string, handlers ...func(*Ctx)) *Group {
|
||||
grp.app.registerMethod(fasthttp.MethodGet, groupPaths(grp.prefix, path), handlers...)
|
||||
grp.app.registerMethod(MethodGet, groupPaths(grp.prefix, path), handlers...)
|
||||
return grp
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue