Documentation ¶
Index ¶
- Constants
- type BaseController
- type EmptyArray
- type EmptyObject
- type HomeController
- func (ctrl *HomeController) GetData(ctx *gin.Context)
- func (ctrl *HomeController) Index(ctx *gin.Context)
- func (ctrl *HomeController) Info(ctx *gin.Context)
- func (ctrl *HomeController) LongAsync(ctx *gin.Context)
- func (ctrl *HomeController) SayHello(c *gin.Context)
- func (ctrl *HomeController) SetData(ctx *gin.Context)
- func (ctrl *HomeController) Test(ctx *gin.Context)
Constants ¶
View Source
const ( // HTTPSuccess 请求成功的时候 http code = 200 // 当然也可以直接用http 包的200状态码 HTTPSuccess = 200 // APIError 业务code !=0的时候,默认API error code APIError = 500 // APISuccess 业务成功code = 0,非0表示错误或异常 APISuccess = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseController ¶
type BaseController struct{}
BaseController 基础控制器
type HomeController ¶
type HomeController struct {
BaseController
}
HomeController home ctrl.
func (*HomeController) GetData ¶
func (ctrl *HomeController) GetData(ctx *gin.Context)
GetData get homeLogic GetData.
func (*HomeController) LongAsync ¶
func (ctrl *HomeController) LongAsync(ctx *gin.Context)
LongAsync When starting new Goroutines inside a middleware or handler, you SHOULD NOT use the original context inside it, you have to use a read-only copy.
func (*HomeController) SayHello ¶
func (ctrl *HomeController) SayHello(c *gin.Context)
SayHello 测试http request然后调用grpc service. http://localhost:1338/say-hello/daheige
func (*HomeController) SetData ¶
func (ctrl *HomeController) SetData(ctx *gin.Context)
SetData 模拟redis set data
Click to show internal directories.
Click to hide internal directories.