interceptor

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainContext

func ChainContext(ctx context.Context) context.Context

ChainContext

func TracerClientStreamInterceptor

func TracerClientStreamInterceptor(tracer opentracing.Tracer) grpc.StreamClientInterceptor

TracerClientStreamInterceptor

func TracerServerStreamInterceptor

func TracerServerStreamInterceptor(tracer opentracing.Tracer) grpc.StreamServerInterceptor

TracerServerStreamInterceptor

func TracerServerUnaryInterceptor

func TracerServerUnaryInterceptor(tracer opentracing.Tracer) grpc.UnaryServerInterceptor

TracerServerUnaryInterceptor

func TracerUnaryClientInterceptor

func TracerUnaryClientInterceptor(tracer opentracing.Tracer) grpc.UnaryClientInterceptor

TracerClientInterceptor https://godoc.org/google.golang.org/grpc#UnaryClientInterceptor

Types

type MDCarrier

type MDCarrier struct {
	metadata.MD
}

MDCarrier custome carrier

func (MDCarrier) ForeachKey

func (m MDCarrier) ForeachKey(handler func(key, val string) error) error

ForeachKey conforms to the TextMapReader interface. TextMapReader is the Extract() carrier for the TextMap builtin format. With it, the caller can decode a propagated SpanContext as entries in a map of unicode strings.

type TextMapReader interface {
	// ForeachKey returns TextMap contents via repeated calls to the `handler`
	// function. If any call to `handler` returns a non-nil error, ForeachKey
	// terminates and returns that error.
	//
	// NOTE: The backing store for the TextMapReader may contain data unrelated
	// to SpanContext. As such, Inject() and Extract() implementations that
	// call the TextMapWriter and TextMapReader interfaces must agree on a
	// prefix or other convention to distinguish their own key:value pairs.
	//
	// The "foreach" callback pattern reduces unnecessary copying in some cases
	// and also allows implementations to hold locks while the map is read.
	ForeachKey(handler func(key, val string) error) error
}

func (MDCarrier) Set

func (m MDCarrier) Set(key, val string)

Set implements Set() of opentracing.TextMapWriter TextMapWriter is the Inject() carrier for the TextMap builtin format. With it, the caller can encode a SpanContext for propagation as entries in a map of unicode strings.

type TextMapWriter interface {
	// Set a key:value pair to the carrier. Multiple calls to Set() for the
	// same key leads to undefined behavior.
	//
	// NOTE: The backing store for the TextMapWriter may contain data unrelated
	// to SpanContext. As such, Inject() and Extract() implementations that
	// call the TextMapWriter and TextMapReader interfaces must agree on a
	// prefix or other convention to distinguish their own key:value pairs.
	Set(key, val string)
}

Jump to

Keyboard shortcuts

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