kits

package module
v0.0.0-...-986a728 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: MIT Imports: 2 Imported by: 9

README

ginkits

Documentation

Index

Constants

View Source
const (
	// ErrorCodeArgumentLack 缺少参数
	ErrorCodeArgumentLack = 100
	// ErrorCodeArgumentTypeInvalid 参数类型错误
	ErrorCodeArgumentTypeInvalid = 101
	// ErrorCodeInvalidSignature 签名错误
	ErrorCodeInvalidSignature = 102
	// ErrorCodeExpiredRequest 请求已过期
	ErrorCodeExpiredRequest = 103
)

Variables

This section is empty.

Functions

func RenderError

func RenderError(c *gin.Context, err interface{})

RenderError 响应错误信息

func RenderErrorMessage

func RenderErrorMessage(c *gin.Context, code string)

func RenderSuccess

func RenderSuccess(c *gin.Context, data interface{})

RenderSuccess 响应成功的数据

Types

type RespErrorMessage

type RespErrorMessage struct {
	Code    int    `json:"code"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Message string `json:"message"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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