Documentation ¶
Index ¶
- Variables
- func APIContextWrapper(f func(c *APIContext)) gin.HandlerFunc
- func APIContexter() gin.HandlerFunc
- func ContextWrapper(f func(c *Context)) gin.HandlerFunc
- func Contexter() gin.HandlerFunc
- type APIContext
- func (ctx *APIContext) Done(status int, data interface{})
- func (ctx *APIContext) Error(status int, code errcode.ErrorCode, obj interface{})
- func (ctx *APIContext) File(filename string, localPath string)
- func (ctx *APIContext) InternalServerError(err error)
- func (ctx *APIContext) JSON(status int, code errcode.ErrorCode, obj interface{})
- func (ctx *APIContext) NotFound(code errcode.ErrorCode, err error)
- func (ctx *APIContext) OK(data interface{})
- func (ctx *APIContext) Storage(filename string, id storage.ID, fileStorage storage.Storage)
- type APIError
- type APIHandlerFunc
- type APIResult
- type Context
Constants ¶
This section is empty.
Variables ¶
View Source
var (
APIContextKey = "ahfs-api-context-key"
)
View Source
var (
ContextKey = "ahfs-context-key"
)
Functions ¶
func APIContextWrapper ¶
func APIContextWrapper(f func(c *APIContext)) gin.HandlerFunc
func APIContexter ¶
func APIContexter() gin.HandlerFunc
func ContextWrapper ¶
func ContextWrapper(f func(c *Context)) gin.HandlerFunc
func Contexter ¶
func Contexter() gin.HandlerFunc
Types ¶
type APIContext ¶
type APIContext struct {
*Context
}
func (*APIContext) Done ¶
func (ctx *APIContext) Done(status int, data interface{})
func (*APIContext) Error ¶
func (ctx *APIContext) Error(status int, code errcode.ErrorCode, obj interface{})
func (*APIContext) File ¶
func (ctx *APIContext) File(filename string, localPath string)
func (*APIContext) InternalServerError ¶
func (ctx *APIContext) InternalServerError(err error)
func (*APIContext) JSON ¶
func (ctx *APIContext) JSON(status int, code errcode.ErrorCode, obj interface{})
func (*APIContext) OK ¶
func (ctx *APIContext) OK(data interface{})
type APIHandlerFunc ¶
type APIHandlerFunc func(*APIContext)
Click to show internal directories.
Click to hide internal directories.