api.go 376 B

12345678910111213141516171819202122
  1. // Copyright 2016 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package context
  5. import (
  6. "gopkg.in/macaron.v1"
  7. )
  8. type APIContext struct {
  9. *Context
  10. }
  11. func APIContexter() macaron.Handler {
  12. return func(c *Context) {
  13. ctx := &APIContext{
  14. Context: c,
  15. }
  16. c.Map(ctx)
  17. }
  18. }