Documentation ¶
Index ¶
Constants ¶
View Source
const ( CodeBoolOk = true CodeIntOk = 0 CodeBoolFail = false )
View Source
const ( OK = "OK" Fail = "Fail" Created = "Created" Accepted = "Accepted" NoContent = "No Content" ResetContent = "Reset Content" BadRequest = "Bad Request" Forbidden = "Forbidden" NotFound = "Not Found" InternalServerError = "Internal Server Error" InternalServerTimeout = "Internal Server Processing Timeout" )
View Source
const ( MessageOK = "请求成功" MessageCreated = "已成功创建资源" MessageAccepted = "已经接受请求, 处理中" MessageNoContent = "处理成功, 无其他响应信息" MessageResetContent = "已成功重置数据" MessageFail = "请求失败" MessageBadRequest = "请求的语法错误,服务器无法理解" MessageForbidden = "没有权限, 请求被服务器拒绝了" MessageNotFound = "所请求的资源不存在" MessageInternalServerError = "服务器内部错误, 无法完成请求" MessageInternalServerTimeout = "服务器处理超时" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Err ¶
type Err struct { Code interface{} `json:"code"` Message string `json:"message"` // contains filtered or unexported fields }
func WrapErrorf ¶
func (*Err) StatusCode ¶
func (*Err) WithStatusCode ¶
type Result ¶
type Result struct { Code interface{} `json:"code"` Message string `json:"message"` Data interface{} `json:"data"` // contains filtered or unexported fields }
func (*Result) StatusCode ¶
func (*Result) WithMessage ¶
func (*Result) WithStatusCode ¶
Click to show internal directories.
Click to hide internal directories.