datastreams

package
v1.60.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFromBase64Carrier

func ExtractFromBase64Carrier(ctx context.Context, carrier TextMapReader) (outCtx context.Context)

ExtractFromBase64Carrier extracts the pathway context from a carrier to a context object

func InjectToBase64Carrier

func InjectToBase64Carrier(ctx context.Context, carrier TextMapWriter)

InjectToBase64Carrier injects a pathway context from a context object inta a carrier

func MergeContexts

func MergeContexts(ctxs ...context.Context) context.Context

MergeContexts returns the first context which includes the pathway resulting from merging the pathways contained in all contexts. This function should be used in fan-in situations. The current implementation keeps only 1 Pathway. A future implementation could merge multiple Pathways together and put the resulting Pathway in the context.

Types

type Pathway

type Pathway interface {
	// GetHash returns the hash of the pathway, representing the upstream path of the data.
	GetHash() uint64
}

func PathwayFromContext

func PathwayFromContext(ctx context.Context) (Pathway, bool)

PathwayFromContext returns the pathway contained in a Go context if present

type TextMapReader

type TextMapReader interface {
	// ForeachKey iterates over all keys that exist in the underlying
	// carrier. It takes a callback function which will be called
	// using all key/value pairs as arguments. ForeachKey will return
	// the first error returned by the handler.
	ForeachKey(handler func(key, val string) error) error
}

TextMapReader allows iterating over sets of key/value pairs. Carriers implementing TextMapReader are compatible to be used with Datadog's TextMapPropagator.

type TextMapWriter

type TextMapWriter interface {
	// Set sets the given key/value pair.
	Set(key, val string)
}

TextMapWriter allows setting key/value pairs of strings on the underlying data structure. Carriers implementing TextMapWriter are compatible to be used with Datadog's TextMapPropagator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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