Documentation ¶
Index ¶
Constants ¶
View Source
const ( Success = 0 WrongKey = -1 Pending = -2 RequireAttention = -3 NotFound = -4 UnknownError = -5 HasDoneAlready = -6 NotEnoughResources = -7 InvalidInput = -10 Timeout = -11 )
定义错误码, 保证前端可以快速接入
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct { Code int `json:"code"` Message string `json:"message,omitempty"` Data interface{} `json:"data,omitempty"` Error string `json:"error,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` }
Response 基础序列化器
type TrackedErrorResponse ¶
TrackedErrorResponse 有追踪信息的错误响应
func (TrackedErrorResponse) Result ¶
func (response TrackedErrorResponse) Result() *TrackedErrorResponse
Click to show internal directories.
Click to hide internal directories.