Help us shape the future of Go! Take the 2026 Go Developer Survey

response

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(c *gin.Context, err error)

Error 输出错误响应 优先解析 *apperror.Error,提取错误码和消息;未识别的错误兜底为 Internal

func Success

func Success(c *gin.Context, message string, data any)

Success 输出成功响应

Types

type Response

type Response struct {
	ErrCode int    `json:"errcode"`
	Message string `json:"message"`
	Data    any    `json:"data"`
	Cost    string `json:"cost"`
	TraceId string `json:"traceId"`
}

Response 响应数据结构体

Jump to

Keyboard shortcuts

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