summaryrefslogtreecommitdiffstats
path: root/modules/context/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/api.go')
-rw-r--r--modules/context/api.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/context/api.go b/modules/context/api.go
new file mode 100644
index 0000000000..0c0cce8cab
--- /dev/null
+++ b/modules/context/api.go
@@ -0,0 +1,22 @@
+// Copyright 2016 The Gogs Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package context
+
+import (
+ "gopkg.in/macaron.v1"
+)
+
+type APIContext struct {
+ *Context
+}
+
+func APIContexter() macaron.Handler {
+ return func(c *Context) {
+ ctx := &APIContext{
+ Context: c,
+ }
+ c.Map(ctx)
+ }
+}