Documentation ¶
Overview ¶
Package reqid creates request IDs and stores them in Contexts.
Index ¶
- Constants
- 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 ¶
View Source
const Unknown = "unknown_req_id"
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, or Unknown, if there is none.
func FromSubContext ¶
FromSubContext returns the sub-request ID stored in ctx, or Unknown if there is none
func NewContext ¶
NewContext returns a new Context that carries reqid.
func NewSubContext ¶
NewSubContext returns a new Context that carries subreqid
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.