Documentation
¶
Index ¶
- func GenerateETag(data []byte) string
- func HttpResult(ctx *app.RequestContext, resp interface{}, err error)
- func ParamErrorFromRequestContext(ctx *app.RequestContext) error
- func ParamErrorResult(ctx *app.RequestContext, err error)
- func ShouldBind(ctx *app.RequestContext, destination any) error
- type HTTPResult
- type NullJson
- type ResponseErrorBean
- type ResponseSuccessBean
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateETag ¶ added in v1.20.2
func HttpResult ¶ added in v1.20.2
func HttpResult(ctx *app.RequestContext, resp interface{}, err error)
HttpResult HTTP Result
func ParamErrorFromRequestContext ¶ added in v1.20.2
func ParamErrorFromRequestContext(ctx *app.RequestContext) error
ParamErrorFromRequestContext returns the parameter error recorded for ctx.
func ParamErrorResult ¶ added in v1.20.2
func ParamErrorResult(ctx *app.RequestContext, err error)
ParamErrorResult Param Error Result
func ShouldBind ¶
func ShouldBind(ctx *app.RequestContext, destination any) error
ShouldBind preserves endpoint request-binding behavior for native Hertz contexts.
Types ¶
type HTTPResult ¶ added in v1.20.2
type HTTPResult struct {
StatusCode int
Body interface{}
}
func BuildHTTPResult ¶ added in v1.20.2
func BuildHTTPResult(resp interface{}, err error) HTTPResult
func BuildParamErrorResult ¶ added in v1.20.2
func BuildParamErrorResult(err error) HTTPResult
type ResponseErrorBean ¶ added in v1.20.2
type ResponseErrorBean struct {
Code uint32 `json:"code"`
Msg string `json:"msg"`
} // @name result.ResponseErrorBean
func Error ¶ added in v1.20.2
func Error(errCode uint32, errMsg string) *ResponseErrorBean
type ResponseSuccessBean ¶ added in v1.20.2
type ResponseSuccessBean struct {
Code uint32 `json:"code"`
Msg string `json:"msg"`
Data interface{} `json:"data,omitempty"`
} // @name result.ResponseSuccessBean
func Success ¶ added in v1.20.2
func Success(data interface{}) *ResponseSuccessBean
Click to show internal directories.
Click to hide internal directories.