Documentation
¶
Index ¶
- func Timeout(opts ...Option) gin.HandlerFunc
- type BaseResponse
- func (r *BaseResponse) GetCode(c *gin.Context) int
- func (r *BaseResponse) GetContent(c *gin.Context) any
- func (r *BaseResponse) GetContentType(c *gin.Context) string
- func (r *BaseResponse) SetCode(code int)
- func (r *BaseResponse) SetContent(content any)
- func (r *BaseResponse) SetContentType(contentType string)
- type CallBackFunc
- type GinCtxCallBackFunc
- type Option
- type PanicInfo
- type Response
- type TimeoutOptions
- type TimeoutWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Timeout ¶
func Timeout(opts ...Option) gin.HandlerFunc
Types ¶
type BaseResponse ¶ added in v0.2.1
func (*BaseResponse) GetContent ¶ added in v0.2.1
func (r *BaseResponse) GetContent(c *gin.Context) any
func (*BaseResponse) GetContentType ¶ added in v0.2.1
func (r *BaseResponse) GetContentType(c *gin.Context) string
func (*BaseResponse) SetCode ¶ added in v0.2.1
func (r *BaseResponse) SetCode(code int)
func (*BaseResponse) SetContent ¶ added in v0.2.1
func (r *BaseResponse) SetContent(content any)
func (*BaseResponse) SetContentType ¶ added in v0.2.1
func (r *BaseResponse) SetContentType(contentType string)
type CallBackFunc ¶ added in v0.0.6
type GinCtxCallBackFunc ¶ added in v0.1.8
type Option ¶ added in v0.0.6
type Option func(*TimeoutWriter)
func WithCallBack ¶ added in v0.0.6
func WithCallBack(f CallBackFunc) Option
WithCallBack Optional parameters
func WithContentType ¶ added in v0.2.1
WithContentType Optional parameters
func WithDefaultMsg ¶ added in v0.0.6
func WithDefaultMsg(resp interface{}) Option
WithDefaultMsg Optional parameters
func WithErrorHttpCode ¶ added in v0.0.6
WithErrorHttpCode Optional parameters
func WithGinCtxCallBack ¶ added in v0.1.8
func WithGinCtxCallBack(f GinCtxCallBackFunc) Option
WithGinCtxCallBack Optional parameters
func WithResponse ¶ added in v0.2.1
func WithTimeout ¶ added in v0.0.6
type TimeoutOptions ¶ added in v0.0.6
type TimeoutOptions struct {
CallBack CallBackFunc
GinCtxCallBack GinCtxCallBackFunc
Timeout time.Duration
Response Response
}
type TimeoutWriter ¶
type TimeoutWriter struct {
gin.ResponseWriter
TimeoutOptions // TimeoutOptions in options.go
// contains filtered or unexported fields
}
func (*TimeoutWriter) Header ¶
func (tw *TimeoutWriter) Header() http.Header
func (*TimeoutWriter) Size ¶ added in v0.1.2
func (tw *TimeoutWriter) Size() int
func (*TimeoutWriter) Status ¶ added in v0.2.0
func (tw *TimeoutWriter) Status() int
func (*TimeoutWriter) WriteHeader ¶
func (tw *TimeoutWriter) WriteHeader(code int)
func (*TimeoutWriter) WriteHeaderNow ¶
func (tw *TimeoutWriter) WriteHeaderNow()
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
custom_response
command
|
|
|
file_server
command
|
|
|
normal
command
|
|
|
panic
command
|
|
|
redirect
command
|
|
|
slow_service
command
|
Click to show internal directories.
Click to hide internal directories.