reqid

package
v0.0.0-...-6d4bf48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package reqid creates request IDs and stores them in Contexts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) string

FromContext returns the request ID stored in ctx, if any.

func FromSubContext

func FromSubContext(ctx context.Context) string

FromSubContext returns the sub-request ID stored in ctx, if any.

func Handler

func Handler(handler http.Handler) http.Handler

func New

func New() string

New generates a random request ID.

func NewContext

func NewContext(ctx context.Context, reqid string) context.Context

NewContext returns a new Context that carries reqid. It also adds a log prefix to print the request ID using package chain/log.

func NewSubContext

func NewSubContext(ctx context.Context, reqid string) context.Context

NewSubContext returns a new Context that carries subreqid It also adds a log prefix to print the sub-request ID using package chain/log.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL