Skip to content
This repository was archived by the owner on Feb 11, 2020. It is now read-only.

Commit 5ed6c19

Browse files
committed
Merge branch 'master' of github.com:gophergala2016/source
2 parents fa2f5ef + 99929ce commit 5ed6c19

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/foundation/context.go

+6
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ type (
5050
Render interface {
5151
HTML(int, string, interface{})
5252
JSON(int, interface{})
53+
Redirect(int, string)
5354
}
5455

5556
Request interface {
@@ -201,6 +202,11 @@ func (c *FoundationContext) JSON(code int, obj interface{}) {
201202
c.opt.JSON(code, obj)
202203
}
203204

205+
// Redirect returns a HTTP redirect to the specific location.
206+
func (c *FoundationContext) Redirect(code int, location string) {
207+
c.opt.Redirect(code, location)
208+
}
209+
204210
////////////////////////////////////////
205211
/// Request interface
206212
////////////////////////////////////////

0 commit comments

Comments
 (0)