summaryrefslogtreecommitdiffstats
path: root/modules/context/api.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-13 17:37:44 -0400
committerUnknwon <u@gogs.io>2016-03-13 17:37:44 -0400
commitdb4da7beecd6a8f65bfa264ba18a8cb12303921f (patch)
treee70f4669159a97ee538f305fce623452191b3ddb /modules/context/api.go
parentb4f47a762338abe6ce3a6e3d6d0896b8a387228d (diff)
downloadgitea-db4da7beecd6a8f65bfa264ba18a8cb12303921f.tar.gz
gitea-db4da7beecd6a8f65bfa264ba18a8cb12303921f.zip
Add APIContext
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)
+ }
+}