Documentation
¶
Index ¶
Constants ¶
View Source
const ( CodeBoolOk = true CodeBoolFail = false )
View Source
const ( OK = "OK" Fail = "OK" 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 ¶
func DefaultJSON ¶
func DefaultJSON(code interface{}, message string) interface{}
Types ¶
type DefaultResp ¶
type DefaultResp struct {
Code interface{} `json:"code"`
Message string `json:"message"`
}
type HttpError ¶
type HttpError struct {
HttpStatusCode int `json:"-"`
Code interface{} `json:"code"`
Message string `json:"message"`
}
func Err2HttpError ¶
func (*HttpError) WithHttpStatusCode ¶
Click to show internal directories.
Click to hide internal directories.