mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 01:57:20 +00: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