http

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess      = 0
	CodeLackParam    = 5000 + iota // 缺少参数
	CodeInvalidParam               // 非法参数
	CodeAccessToken                // 获取access token 出错
	CodeVerifyToken                // 验证access token 出错
	CodeIllegalToken               // 非法token
	CodeNodeID                     // 获取 node id 失败
)

Variables

This section is empty.

Functions

func NewHttpController

func NewHttpController(uc service.UseCase) controller.Controller

Types

type ControllerOnHttp

type ControllerOnHttp struct {
	// contains filtered or unexported fields
}

func (*ControllerOnHttp) ErrorLog

func (c *ControllerOnHttp) ErrorLog(ctx *gin.Context, resp *Response)

func (*ControllerOnHttp) GetNodeID

func (c *ControllerOnHttp) GetNodeID(ctx *gin.Context)

func (*ControllerOnHttp) ResponseWithCode

func (c *ControllerOnHttp) ResponseWithCode(ctx *gin.Context, code int)

ResponseWithCode ...

func (*ControllerOnHttp) ResponseWithData

func (c *ControllerOnHttp) ResponseWithData(ctx *gin.Context, data interface{})

ResponseWithData ...

func (*ControllerOnHttp) ResponseWithDesc

func (c *ControllerOnHttp) ResponseWithDesc(ctx *gin.Context, code int, desc string)

ResponseWithDesc ...

type Response

type Response struct {
	ErrCode int    `json:"errCode"`
	ErrDesc string `json:"errDesc"`
}

Response ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL