Documentation ¶
Index ¶
- Variables
- type PageInfo
- type PageResult
- type Response
- func (re *Response) Init(code *ResponseCode, hint string, result interface{})
- func (re *Response) InitError(code *ResponseCode, hint string)
- func (re *Response) InitFromResp(srcResp *Response)
- func (re *Response) InitPageSuccess(total int64, pageNo, pageSize int, results interface{})
- func (re *Response) InitSuccess()
- func (re *Response) InitSuccessFull(hint string, result interface{})
- func (re *Response) InitSuccessHint(hint string)
- func (re *Response) InitSuccessResult(result interface{})
- func (re *Response) IsSuccess() bool
- type ResponseCode
Constants ¶
This section is empty.
Variables ¶
View Source
var DB_ERROR = &ResponseCode{Code: "RC80000", Info: "DBError"}
View Source
var DB_NOT_FOUND = &ResponseCode{Code: "RC80404", Info: "DBError: record not found"}
View Source
var GENERAL_ERROR = &ResponseCode{Code: "RC60000", Info: "FAILURE"}
View Source
var MGMT_TOKEN_DISABLE_ERROR = &ResponseCode{Code: "RC50090", Info: "MgmtTokenDisabled"}
View Source
var MGMT_TOKEN_EXPIRE_ERROR = &ResponseCode{Code: "RC50099", Info: "MgmtTokenExpireOrInvalid: %s"}
View Source
var PARAM_ERROR = &ResponseCode{Code: "RC70000", Info: "ParamError"}
View Source
var SUCCESS = &ResponseCode{Code: "RC00000", Info: "SUCCESS"}
View Source
var SYS_ERROR = &ResponseCode{Code: "RC90000", Info: "SysError"}
View Source
var TOKEN_EXPIRE_ERROR = &ResponseCode{Code: "RC50000", Info: "TokenExpireOrInvalid"}
Functions ¶
This section is empty.
Types ¶
type PageResult ¶
type PageResult struct { PageInfo *PageInfo `json:"page_info,omitempty"` Data interface{} `json:"data,omitempty"` }
type Response ¶
type Response struct { Code string `json:"code"` Info string `json:"info"` Result interface{} `json:"result,omitempty"` }
func (*Response) Init ¶
func (re *Response) Init(code *ResponseCode, hint string, result interface{})
func (*Response) InitError ¶
func (re *Response) InitError(code *ResponseCode, hint string)
func (*Response) InitFromResp ¶
func (*Response) InitPageSuccess ¶
func (*Response) InitSuccess ¶
func (re *Response) InitSuccess()
func (*Response) InitSuccessFull ¶
func (*Response) InitSuccessHint ¶
func (*Response) InitSuccessResult ¶
func (re *Response) InitSuccessResult(result interface{})
type ResponseCode ¶
Click to show internal directories.
Click to hide internal directories.