forked from forgejo/forgejo
Add APIContext
This commit is contained in:
parent
b4f47a7623
commit
db4da7beec
8 changed files with 93 additions and 63 deletions
22
modules/context/api.go
Normal file
22
modules/context/api.go
Normal file
|
@ -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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue