hchi

package
v0.0.0-...-089553b Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package hchi provides functions to support embedded and retrieving a request id from a go context tree

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestID

func RequestID(ctx context.Context) string

RequestID returns the request id carried in the context, if any. It returns "" if no request id has been set or the context is nil.

func WithChiRequestID

func WithChiRequestID(ctx context.Context) context.Context

WithChiRequestID gets the request id from the chi middleware, sets in a new context and returns the context.

func WithRequestID

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

WithRequestID sets the reqid in a new context and returns that context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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