goext/ginext/commonHandler.go

24 lines
503 B
Go
Raw Normal View History

2023-07-18 14:40:10 +02:00
package ginext
import (
"net/http"
)
2023-07-18 15:23:32 +02:00
func RedirectFound(newuri string) WHandlerFunc {
return func(pctx PreContext) HTTPResponse {
return Redirect(http.StatusFound, newuri)
2023-07-18 14:40:10 +02:00
}
}
2023-07-18 15:23:32 +02:00
func RedirectTemporary(newuri string) WHandlerFunc {
return func(pctx PreContext) HTTPResponse {
return Redirect(http.StatusTemporaryRedirect, newuri)
2023-07-18 14:40:10 +02:00
}
}
2023-07-18 15:23:32 +02:00
func RedirectPermanent(newuri string) WHandlerFunc {
return func(pctx PreContext) HTTPResponse {
return Redirect(http.StatusPermanentRedirect, newuri)
2023-07-18 14:40:10 +02:00
}
}