Documentation ¶
Index ¶
- Constants
- func PutResponse(resp *Response)
- func SetCodeMessager(messager CodeMessager)
- type CodeMessager
- type Response
- func Error(status int) *Response
- func Fail(code int) *Response
- func FailData(code int, data interface{}) *Response
- func NewResponse(status, code int, data interface{}, message string) *Response
- func Ok() *Response
- func OkCode(code int) *Response
- func OkCodeData(code int, data interface{}) *Response
- func OkData(data interface{}) *Response
Constants ¶
View Source
const ( SuccessCode = iota FailCode ErrorCode )
Variables ¶
This section is empty.
Functions ¶
func PutResponse ¶
func PutResponse(resp *Response)
func SetCodeMessager ¶
func SetCodeMessager(messager CodeMessager)
SetCodeMessager 设置一个CodeMessager,该函数可以从code获取message
Types ¶
type CodeMessager ¶
type Response ¶
type Response struct { HttpStatus int R resResult }
func NewResponse ¶
func OkCodeData ¶
Click to show internal directories.
Click to hide internal directories.