Documentation ¶
Index ¶
- func AuthHttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)
- func HttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)
- func JobResult(ctx context.Context, resp interface{}, err error)
- func NewCodeError(code int, msg string) error
- func NewDefaultError(msg string) error
- func ParamErrorResult(r *http.Request, w http.ResponseWriter, err error)
- type Body
- type CodeError
- type CodeErrorResponse
- type NullJson
- type ResponseErrorBean
- type ResponseSuccessBean
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthHttpResult ¶
func AuthHttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)
授权的http方法
func HttpResult ¶
func HttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)
http返回
func NewCodeError ¶ added in v0.1.14
func NewDefaultError ¶ added in v0.1.14
func ParamErrorResult ¶
func ParamErrorResult(r *http.Request, w http.ResponseWriter, err error)
http 参数错误返回
Types ¶
type CodeError ¶ added in v0.1.14
func (*CodeError) Data ¶ added in v0.1.14
func (e *CodeError) Data() *CodeErrorResponse
type CodeErrorResponse ¶ added in v0.1.14
type ResponseErrorBean ¶
type ResponseSuccessBean ¶
type ResponseSuccessBean struct { Code uint32 `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` TraceID string `json:"traceId,omitempty"` }
func Success ¶
func Success(data interface{}, ctx context.Context) *ResponseSuccessBean
Click to show internal directories.
Click to hide internal directories.