Documentation ¶
Index ¶
- Constants
- Variables
- func BusinessCode(code uint32) (spb *spbStatus)
- func BusinessCodeAdd(code uint32, message string) *spbStatus
- func CodeAdds(data []CodeInfo)
- func ExtractCodes(e error) *spbStatus
- func SystemCode(code uint32) (spb *spbStatus)
- func SystemCodeAdd(code uint32, message string) *spbStatus
- func XCodeBusinessCodeHttp(w http.ResponseWriter, r *http.Request)
- func XCodeSystemCodeHttp(w http.ResponseWriter, r *http.Request)
- type CodeInfo
Constants ¶
View Source
const ( CodeBreakUp uint32 = 9999 SystemType = iota BusinessType )
CodeBreakUp 低于10000均为系统错误码,业务错误码请使用10000以上
Variables ¶
View Source
var ( // OK ... OK = add(SystemType, uint32(codes.OK), "OK") Unknown = add(SystemType, uint32(codes.Unknown), "UNKNOWN") )
Functions ¶
func BusinessCode ¶
func BusinessCode(code uint32) (spb *spbStatus)
func BusinessCodeAdd ¶
func SystemCode ¶
func SystemCode(code uint32) (spb *spbStatus)
func SystemCodeAdd ¶
func XCodeBusinessCodeHttp ¶
func XCodeBusinessCodeHttp(w http.ResponseWriter, r *http.Request)
func XCodeSystemCodeHttp ¶
func XCodeSystemCodeHttp(w http.ResponseWriter, r *http.Request)
Types ¶
Click to show internal directories.
Click to hide internal directories.