Documentation ¶
Overview ¶
Package reqid creates request IDs and stores them in Contexts.
Index ¶
- func CoreIDFromContext(ctx context.Context) string
- func FromContext(ctx context.Context) string
- func FromSubContext(ctx context.Context) string
- func Handler(handler http.Handler) http.Handler
- func New() string
- func NewContext(ctx context.Context, reqid string) context.Context
- func NewSubContext(ctx context.Context, reqid string) context.Context
- func PathFromContext(ctx context.Context) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoreIDFromContext ¶
CoreIDFromContext returns the Chain-Core-ID stored in ctx, or the empty string.
func FromContext ¶
FromContext returns the request ID stored in ctx, if any.
func FromSubContext ¶
FromSubContext returns the sub-request ID stored in ctx, if any.
func NewContext ¶
NewContext returns a new Context that carries reqid. It also adds a log prefix to print the request ID using package bytom/log.
func PathFromContext ¶
PathFromContext returns the HTTP path stored in ctx, or the empty string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.