Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeBody(r io.ReadCloser) zap.Field
- func DecodeBodyFromRequest(r *http.Request) zap.Field
- func DecodeBodyFromResponse(r *http.Response) zap.Field
- func DecodeHeader(h http.Header) zap.Field
- func DecodeHeaderFromRequest(r *http.Request) zap.Field
- func DecodeHeaderFromResponse(r *http.Response) zap.Field
- func GetNextRequestID() string
- func GetReqID(ctx context.Context) string
- func Level(level string) zapcore.Level
- func LoggerFromReqID(ctx context.Context) *zap.Logger
- type Config
Constants ¶
View Source
const RequestIDKey ctxKeyRequestID = 0
RequestIDKey is the key that holds the unique request ID in a request context.
Variables ¶
View Source
var (
Logger *zap.Logger
)
View Source
var RequestIDHeader = "X-Request-Id"
RequestIDHeader is the name of the HTTP Header which contains the request id. Exported so that it can be changed by developers
Functions ¶
func DecodeBody ¶
func DecodeBody(r io.ReadCloser) zap.Field
func GetNextRequestID ¶
func GetNextRequestID() string
Types ¶
Click to show internal directories.
Click to hide internal directories.