Documentation
¶
Index ¶
- func GinRespond[T any](c *gin.Context, httpStatus int, code int, msg string, body T)
- func GinRespondError(c *gin.Context, httpStatus int, code int, msg string)
- func GinRespondOK[T any](c *gin.Context, body T)
- func Response[T any](ctx context.Context, w http.ResponseWriter, code int, msg string, body T)
- func ResponseFail(ctx context.Context, w http.ResponseWriter, msg string)
- func ResponseSucc[T any](ctx context.Context, w http.ResponseWriter, body T)
- type ResponseHeadInfo
- type ResponseInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinRespond ¶
func GinRespondOK ¶
func ResponseFail ¶
func ResponseFail(ctx context.Context, w http.ResponseWriter, msg string)
func ResponseSucc ¶
func ResponseSucc[T any](ctx context.Context, w http.ResponseWriter, body T)
Types ¶
type ResponseHeadInfo ¶
type ResponseInfo ¶
type ResponseInfo[T any] struct { Head ResponseHeadInfo `json:"head"` Body T `json:"body,omitempty"` }
Click to show internal directories.
Click to hide internal directories.