Documentation ¶
Index ¶
- Variables
- type Helper
- func (h Helper) Bind(c *gin.Context, obj interface{}) error
- func (h Helper) BindQuery(c *gin.Context, obj interface{}) error
- func (h Helper) BindSession(c *gin.Context) (result *cookie.Session)
- func (h Helper) BindURI(c *gin.Context, obj interface{}) (e error)
- func (h Helper) BindWith(c *gin.Context, obj interface{}, b binding.Binding) (e error)
- func (h Helper) CheckRoot(c *gin.Context)
- func (h Helper) CheckSession(c *gin.Context)
- func (h Helper) CheckShell(c *gin.Context)
- func (h Helper) CheckWebsocket(c *gin.Context)
- func (h Helper) NegotiateData(c *gin.Context, code int, data interface{})
- func (h Helper) NegotiateError(c *gin.Context, code int, e error)
- func (h Helper) NegotiateErrorString(c *gin.Context, code int, e string)
- func (Helper) ShouldBindSession(c *gin.Context) (session *cookie.Session, e error)
- func (h Helper) WriteJSON(ws *websocket.Conn, obj interface{}) (e error)
- type IHelper
Constants ¶
This section is empty.
Variables ¶
View Source
var Offered = []string{ binding.MIMEJSON, binding.MIMEHTML, binding.MIMEXML, binding.MIMEYAML, }
Offered accept Offered
Functions ¶
This section is empty.
Types ¶
type Helper ¶
type Helper struct { }
Helper 爲所有 控制器 定義了 通用的輔助方法
func (Helper) BindSession ¶
BindSession 返回 session 並響應錯誤
func (Helper) CheckSession ¶
CheckSession 檢查是否具有 session
func (Helper) CheckWebsocket ¶
CheckWebsocket 驗證請求是否是 websocket
func (Helper) NegotiateData ¶
NegotiateData .
func (Helper) NegotiateError ¶
NegotiateError .
func (Helper) NegotiateErrorString ¶
NegotiateErrorString .
func (Helper) ShouldBindSession ¶
ShouldBindSession 返回session 不進行響應
Click to show internal directories.
Click to hide internal directories.