mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-21 17:17:48 +08:00
Add APIContext
This commit is contained in:
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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user