v0.0.172
This commit is contained in:
24
ginext/commonHandler.go
Normal file
24
ginext/commonHandler.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package ginext
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func RedirectFound(newuri string) gin.HandlerFunc {
|
||||
return func(g *gin.Context) {
|
||||
g.Redirect(http.StatusFound, newuri)
|
||||
}
|
||||
}
|
||||
|
||||
func RedirectTemporary(newuri string) gin.HandlerFunc {
|
||||
return func(g *gin.Context) {
|
||||
g.Redirect(http.StatusTemporaryRedirect, newuri)
|
||||
}
|
||||
}
|
||||
|
||||
func RedirectPermanent(newuri string) gin.HandlerFunc {
|
||||
return func(g *gin.Context) {
|
||||
g.Redirect(http.StatusPermanentRedirect, newuri)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user