queuecontext

package
v2.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package queuecontext provides convenient wrappers for storing and accessing a stored metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetachedContext

func DetachedContext(ctx context.Context) context.Context

DetachedContext returns a new context detached from the lifetime of ctx, but which still returns the values of ctx.

DetachedContext can be used to maintain the context values required to correlate events, but where the operation is "fire-and-forget", and should not be affected by the deadline or cancellation of ctx.

func MetadataFromContext

func MetadataFromContext(ctx context.Context) (map[string]string, bool)

MetadataFromContext returns the metadata from the passed context and a bool indicating whether the value is present or not.

func WithMetadata

func WithMetadata(ctx context.Context, metadata map[string]string) context.Context

WithMetadata enriches a context with metadata.

Types

This section is empty.

Jump to

Keyboard shortcuts

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