Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpResult ¶
func HttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)
func SpanIDFromContext ¶ added in v1.0.2
func TraceIDFromContext ¶ added in v1.0.2
Types ¶
type ResponseFail ¶
type ResponseFail struct { Success bool `json:"success"` Message string `json:"message"` Code errx.ErrCode `json:"code"` Trace string `json:"trace"` Span string `json:"span"` }
func FailWithTrace ¶ added in v1.0.2
func FailWithTrace(errCode errx.ErrCode, errMsg string, span, trace string) *ResponseFail
type ResponseOk ¶
type ResponseOk struct { Success bool `json:"success"` Message string `json:"message"` Data interface{} `json:"data"` }
func Success ¶
func Success(data interface{}) *ResponseOk
Click to show internal directories.
Click to hide internal directories.