Documentation ¶
Index ¶
- func ReleaseCtx(c *GinContext)
- type GinContext
- func (c *GinContext) BindQuery(obj any) error
- func (c *GinContext) BodyParser(model any) error
- func (c *GinContext) ClientIP() string
- func (c *GinContext) ContentType() string
- func (c *GinContext) Cookie(name string) (string, error)
- func (c *GinContext) Ctx() any
- func (c *GinContext) CustomBindQueryMethod() bool
- func (c *GinContext) CustomShouldBindMethod() bool
- func (c *GinContext) File(filepath string) error
- func (c *GinContext) FileAttachment(filepath, filename string) error
- func (c *GinContext) Get(key string) (value any, exists bool)
- func (c *GinContext) GetHeader(key string) string
- func (c *GinContext) Header(key, value string)
- func (c *GinContext) JSON(statusCode int, data any) error
- func (c *GinContext) JSONP(code int, data any) error
- func (c *GinContext) Method() string
- func (c *GinContext) Params(key string, undefined ...string) string
- func (c *GinContext) Path() string
- func (c *GinContext) Query(key string, undefined ...string) string
- func (c *GinContext) Redirect(code int, location string) error
- func (c *GinContext) RenderHTML(name string, bind interface{}, layouts ...string) error
- func (c *GinContext) SendStream(stream io.Reader, size ...int) error
- func (c *GinContext) SendString(s string) error
- func (c *GinContext) Set(key string, value any)
- func (c *GinContext) SetCookie(cookie *http.Cookie)
- func (c *GinContext) ShouldBind(obj any) error
- func (c *GinContext) Status(statusCode int)
- func (c *GinContext) TOML(code int, obj any) error
- func (c *GinContext) Validate(obj any) error
- func (c *GinContext) Write(p []byte) (int, error)
- func (c *GinContext) XML(code int, obj any) error
- func (c *GinContext) YAML(code int, obj any) error
- type GinMux
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReleaseCtx ¶ added in v0.2.9
func ReleaseCtx(c *GinContext)
Types ¶
type GinContext ¶
type GinContext struct {
// contains filtered or unexported fields
}
func AcquireCtx ¶ added in v0.2.9
func AcquireCtx(c *gin.Context) *GinContext
func (*GinContext) BindQuery ¶
func (c *GinContext) BindQuery(obj any) error
func (*GinContext) BodyParser ¶
func (c *GinContext) BodyParser(model any) error
func (*GinContext) ClientIP ¶
func (c *GinContext) ClientIP() string
func (*GinContext) ContentType ¶ added in v0.2.8
func (c *GinContext) ContentType() string
func (*GinContext) Cookie ¶
func (c *GinContext) Cookie(name string) (string, error)
Cookie 解析cookies参数
func (*GinContext) Ctx ¶ added in v0.2.8
func (c *GinContext) Ctx() any
func (*GinContext) CustomBindQueryMethod ¶ added in v0.2.9
func (c *GinContext) CustomBindQueryMethod() bool
CustomBindQueryMethod 无需自定义实现
func (*GinContext) CustomShouldBindMethod ¶ added in v0.2.9
func (c *GinContext) CustomShouldBindMethod() bool
CustomShouldBindMethod 需要自定义实现请求体解析方法
func (*GinContext) File ¶
func (c *GinContext) File(filepath string) error
func (*GinContext) FileAttachment ¶
func (c *GinContext) FileAttachment(filepath, filename string) error
func (*GinContext) GetHeader ¶ added in v0.2.9
func (c *GinContext) GetHeader(key string) string
GetHeader 解析请求头参数
func (*GinContext) Header ¶
func (c *GinContext) Header(key, value string)
func (*GinContext) Method ¶
func (c *GinContext) Method() string
func (*GinContext) Params ¶
func (c *GinContext) Params(key string, undefined ...string) string
Params 解析路径参数
func (*GinContext) Path ¶
func (c *GinContext) Path() string
func (*GinContext) RenderHTML ¶ added in v0.2.9
func (c *GinContext) RenderHTML(name string, bind interface{}, layouts ...string) error
func (*GinContext) SendStream ¶
func (c *GinContext) SendStream(stream io.Reader, size ...int) error
func (*GinContext) SendString ¶
func (c *GinContext) SendString(s string) error
func (*GinContext) Set ¶
func (c *GinContext) Set(key string, value any)
func (*GinContext) SetCookie ¶
func (c *GinContext) SetCookie(cookie *http.Cookie)
func (*GinContext) ShouldBind ¶
func (c *GinContext) ShouldBind(obj any) error
func (*GinContext) Status ¶
func (c *GinContext) Status(statusCode int)
func (*GinContext) Validate ¶
func (c *GinContext) Validate(obj any) error
Click to show internal directories.
Click to hide internal directories.