Documentation
¶
Index ¶
- type Response
- func Fail(ctx *gin.Context) *Response
- func Forbidden(ctx *gin.Context) *Response
- func InternalFailed(ctx *gin.Context) *Response
- func NewResponse(ctx *gin.Context) *Response
- func Ok(ctx *gin.Context) *Response
- func Status(ctx *gin.Context, statusCode int) *Response
- func UnAuthorized(ctx *gin.Context) *Response
- func (r *Response) Code(code int) *Response
- func (r *Response) Data(data any) *Response
- func (r *Response) Error(err error) *Response
- func (r *Response) Msg(msg string) *Response
- func (r *Response) MsgI18n(langCode string) *Response
- func (r *Response) Send()
- func (r *Response) Status(status int) *Response
- func (r *Response) Transparent() *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct { // custom CustomCode CustomCode int `json:"code"` // response mgs Message string `json:"msg,omitempty"` // response Payload Payload any `json:"data,omitempty"` // response ErrorMsg ErrorMsg string `json:"error,omitempty"` // contains filtered or unexported fields }
func Fail ¶
Fail means that the request is unsuccessful, the result usually caused by client, not server like incorrect parameters
func InternalFailed ¶
InternalFailed means that the request is unsuccessful, the reason usually caused by server
func NewResponse ¶
func UnAuthorized ¶
func (*Response) Transparent ¶
Click to show internal directories.
Click to hide internal directories.