baggage

package
v2.12.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Headers

type Headers map[string]string

Headers is a header map.

type Propagator

type Propagator interface {
	// Extract extracts flow labels from headers
	Extract(headers Headers) flowlabel.FlowLabels

	// Inject emits instructions for envoy how to inject flow labels into
	// headers based on given flow labels and existing headers
	//
	// The returned list is expected to be put in
	// CheckResponse.OkHttpResponse.Headers, so that envoy will take care of
	// injecting appropriate headers.
	Inject(flowLabels flowlabel.FlowLabels, headers Headers) (map[string]string, error)
}

Propagator defines how to extract flow labels (baggage) from and put into headers.

type W3Baggage

type W3Baggage struct{}

W3Baggage handles baggage propagation in a single `baggage` header, as described in https://www.w3.org/TR/baggage/

All baggage items are mapped to flow labels 1:1. This could be tweaked in future: * we can use some prefixing/filtering, * alternatively, we could put _all_ flow labels as a _single_ baggage item (eg. Fn-flow).

func (W3Baggage) Extract

func (b W3Baggage) Extract(headers Headers) flowlabel.FlowLabels

Extract extracts flow labels from w3Baggage headers.

func (W3Baggage) Inject

func (b W3Baggage) Inject(
	flowLabels flowlabel.FlowLabels,
	headers Headers,
) (map[string]string, error)

Inject emits instructions for envoy how to inject flow labels into headers supported by baggage propagator.

Jump to

Keyboard shortcuts

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