Documentation
¶
Index ¶
- type Context
- func (c *Context) Cookie(key string) Value
- func (c *Context) Error(code int, msg string)
- func (c *Context) EventStream() chan []byte
- func (c *Context) Header(key string) Value
- func (c *Context) JSON(code int, obj any)
- func (c *Context) Param(key string) Value
- func (c *Context) Query(key string) Value
- func (c *Context) SetUserId(userId string)
- func (c *Context) Success(data any)
- func (c *Context) UserId() string
- type Value
- func (v Value) Bool() (bool, error)
- func (v Value) BoolOr(defaultVal bool) bool
- func (v Value) Int() (int, error)
- func (v Value) Int64() (int64, error)
- func (v Value) Int64Or(defaultVal int64) int64
- func (v Value) IntOr(defaultVal int) int
- func (v Value) String() (string, error)
- func (v Value) StringOr(defaultVal string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context 是对 gin.Context 的增强封装 提供了更便捷的参数获取和类型转换方法
func (*Context) EventStream ¶
EventStream 返回一个用于 Server-Sent Events 的通道 用于实现服务器推送功能 注意:调用者需要在完成后关闭返回的 channel
Click to show internal directories.
Click to hide internal directories.