Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ERROR = NewRpcError(-1, "ERROR") SUCCESS = NewRpcSuccess(200, "SUCCESS") DEFAULT = NewErrorCode(math.MaxInt32, "DEFAULT") )
Functions ¶
This section is empty.
Types ¶
type RpcError ¶
type RpcError ErrorCode
RpcError 定义一个 RPC 异常值
func (RpcError) PanicImmediately ¶
PanicImmediately 立即抛出一个异常值
type RpcResult ¶
type RpcResult struct { ErrorCode Err string `json:"err,omitempty"` // 错误源 Data interface{} `json:"data,omitempty"` // 返回值 }
RpcResult 定义 RPC 返回值
type RpcSuccess ¶
type RpcSuccess ErrorCode
RpcSuccess 定义一个 RPC 成功值
func NewRpcSuccess ¶
func NewRpcSuccess(code int32, msg string) RpcSuccess
NewRpcSuccess RpcSuccess 的构造函数
Click to show internal directories.
Click to hide internal directories.