simbaContext

package
v0.30.0-dev Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LoggerKey          LoggerContextKey  = "logger"
	TraceIDKey         TraceIDContextKey = "traceId"
	TraceIDHeader      string            = "X-Trace-Id"
	RequestSettingsKey RequestContextKey = "requestSettings"
)

Variables

This section is empty.

Functions

func GetTraceID added in v0.27.5

func GetTraceID(ctx context.Context) string

GetTraceID retrieves the trace ID from the context. If no trace ID is present, it returns an empty string.

func WithExistingOrNewTraceID added in v0.27.5

func WithExistingOrNewTraceID(ctx context.Context) context.Context

WithExistingOrNewTraceID returns a context with a trace ID. If the context already has a trace ID, it is reused.

func WithTraceID added in v0.27.5

func WithTraceID(ctx context.Context, traceID string) context.Context

WithTraceID returns a context with the provided trace ID.

func WithTraceIDAndLogger added in v0.27.6

func WithTraceIDAndLogger(ctx context.Context) context.Context

WithTraceIDAndLogger returns a context with a trace ID (existing or new) and a logger that includes the trace ID.

func WithTraceIDLogger added in v0.27.6

func WithTraceIDLogger(ctx context.Context) context.Context

WithTraceIDLogger returns a context with a logger that includes the trace ID.

Types

type LoggerContextKey

type LoggerContextKey string

type RequestContextKey

type RequestContextKey string

type TraceIDContextKey added in v0.27.2

type TraceIDContextKey string

Jump to

Keyboard shortcuts

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