package
0.0.0-20180704120643-39cffea1dab6
Repository: https://github.com/leopoldxx/go-utils.git
Documentation: pkg.go.dev
# Packages
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
# Functions
GetRealIPFromContext get the remote endpoint from request, if not found, return an empty string.
GetTraceFromContext get the Trace var from the context, if there is no such a trace utility, return nil.
GetTraceFromRequest get the Trace var from the req context, if there is no such a trace utility, return nil.
HandleCrash xx.
HandleFunc wrap a trace handle func outer the original http handle func.
Handler wrap a trace handler outer the original http.Handler.
LogCrashStack for stack.
New will create a Trace using a name, identifying the trace process.
copy this from glog.
WithID will create a Trace with a name and a trace id.
WithParent will create a Trace use a parent Trace and a identified name.
WithTraceForContext will return a new context wrapped a trace handler around the original ctx.
WithTraceForContext2 will return a new context wrapped a trace handler around the original ctx.
# Interfaces
Trace is a log trace utils wrapped on glog, can be used to trace a http request and its subrequests.