contextutils

package
v0.8.0-rc2 Latest Latest
Warning

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

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

Documentation

Overview

Package contextutils provides utility for adding and retrieving metadata to/from a context.

Index

Constants

View Source
const (
	// MetadataContextKey is the key used to access metadata from a context with metadata.
	MetadataContextKey = contextKey("viam-metadata")

	// TimeRequestedMetadataKey is optional metadata in the gRPC response header that correlates
	// to the time right before the point cloud was captured.
	TimeRequestedMetadataKey = "viam-time-requested"

	// TimeReceivedMetadataKey is optional metadata in the gRPC response header that correlates
	// to the time right after the point cloud was captured.
	TimeReceivedMetadataKey = "viam-time-received"
)

Variables

This section is empty.

Functions

func ContextWithMetadata

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

ContextWithMetadata attaches a metadata map to the context.

func ContextWithMetadataUnaryClientInterceptor

func ContextWithMetadataUnaryClientInterceptor(
	ctx context.Context,
	method string,
	req, reply interface{},
	cc *grpc.ClientConn,
	invoker grpc.UnaryInvoker,
	opts ...grpc.CallOption,
) error

ContextWithMetadataUnaryClientInterceptor attempts to read metadata from the gRPC header and injects the metadata into the context if the caller has passed in 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