Documentation ¶
Index ¶
- Variables
- type Result
- func (result *Result) Clone() *Result
- func (result *Result) Error() string
- func (result *Result) SetCode(code int64) *Result
- func (result *Result) SetData(v interface{}) *Result
- func (result *Result) SetError(v error) *Result
- func (result *Result) SetHttpStatus(v int) *Result
- func (result *Result) SetMessage(v string) *Result
- func (result *Result) String() string
- func (result *Result) WriteJson(ctx *gin.Context)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OK = Result{Code: 0, Msg: "ok", HttpStatus: 200} InternalError = Result{Code: -1, Msg: "internal error", HttpStatus: 500} ConnectError = Result{Code: 1001, Msg: "connect error", HttpStatus: 500} SettingNilError = Result{Code: 1002, Msg: "setting is nil", HttpStatus: 500} )
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct { Code int64 `json:"code"` Msg string `json:"message"` Data interface{} `json:"data,omitempty"` Err error `json:"error,omitempty"` HttpStatus int `json:"-"` }
func (*Result) SetHttpStatus ¶ added in v0.0.11
func (*Result) SetMessage ¶ added in v0.0.11
Click to show internal directories.
Click to hide internal directories.