transport

package
v1.1.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PrefixPass = "x-pass-"
)

Variables

View Source
var CustomKeysMapPropagator propagation.TextMapPropagator = &CustomKeys{}

Functions

func GetMapFromContext

func GetMapFromContext(ctx context.Context) map[string]string

func GetMapFromPropagator

func GetMapFromPropagator(carrier propagation.TextMapCarrier) map[string]string

func RegisterCustomKeys

func RegisterCustomKeys(keys []string)

RegisterCustomKeys 注册全局 custom keys key 必须为纯小写否则 panic 只应该在程序启动前全局注册一次 是以 append 的形式, 支持多次调用 为 lib 库预留扩展空间

Types

type CustomKeys

type CustomKeys struct{}

func (*CustomKeys) Extract

func (*CustomKeys) Fields

func (c *CustomKeys) Fields() []string

Fields not used

func (*CustomKeys) Inject

func (c *CustomKeys) Inject(ctx context.Context, carrier propagation.TextMapCarrier)

type GrpcHeaderCarrier

type GrpcHeaderCarrier metadata.MD

GrpcHeaderCarrier ...

func (GrpcHeaderCarrier) Get

func (mc GrpcHeaderCarrier) Get(key string) string

Get returns the value associated with the passed key.

func (GrpcHeaderCarrier) Keys

func (mc GrpcHeaderCarrier) Keys() []string

Keys lists the keys stored in this carrier.

func (GrpcHeaderCarrier) Set

func (mc GrpcHeaderCarrier) Set(key string, value string)

Set stores the key-value pair.

Jump to

Keyboard shortcuts

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