xcode

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

* * @Author: myxy99 <myxy99@foxmail.com> * @Date: 2021/1/2 12:56

* * @Author: myxy99 <myxy99@foxmail.com> * @Date: 2021/1/2 12:55

Index

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 BusinessCodeAdd(code uint32, message string) *spbStatus

func CodeAdds

func CodeAdds(data []CodeInfo)

func ExtractCodes

func ExtractCodes(e error) *spbStatus

ExtractCodes cause from error to ecode.

func GovernRun

func GovernRun()

func SystemCode

func SystemCode(code uint32) (spb *spbStatus)

func SystemCodeAdd

func SystemCodeAdd(code uint32, message string) *spbStatus

Types

type CodeInfo

type CodeInfo struct {
	CodeT   uint
	Code    uint32
	Message string
}

Jump to

Keyboard shortcuts

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