mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
29 lines
595 B
Go
29 lines
595 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/iron-io/functions/api/models"
|
|
)
|
|
|
|
type SpecialHandlerContext struct {
|
|
server *Server
|
|
ginContext *gin.Context
|
|
}
|
|
|
|
func (c *SpecialHandlerContext) Request() *http.Request {
|
|
return c.ginContext.Request
|
|
}
|
|
|
|
func (c *SpecialHandlerContext) Datastore() models.Datastore {
|
|
return c.server.Datastore
|
|
}
|
|
|
|
func (c *SpecialHandlerContext) Set(key string, value interface{}) {
|
|
c.ginContext.Set(key, value)
|
|
}
|
|
func (c *SpecialHandlerContext) Get(key string) (value interface{}, exists bool) {
|
|
return c.ginContext.Get(key)
|
|
}
|