Documentation ¶
Index ¶
- func HttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)
- func SpanIDFromContext(ctx context.Context) string
- func TokenHandle(next http.HandlerFunc) http.HandlerFunc
- func TraceIDFromContext(ctx context.Context) string
- type AuthorizationName
- type ResponseFail
- type ResponseOk
- type TokenKey
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 TokenHandle ¶ added in v1.2.76
func TokenHandle(next http.HandlerFunc) http.HandlerFunc
func TraceIDFromContext ¶ added in v1.0.2
Types ¶
type AuthorizationName ¶ added in v1.2.77
type AuthorizationName string
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.