Documentation ¶
Index ¶
Constants ¶
View Source
const (
PrefixPass = "x-pass-"
)
Variables ¶
View Source
var CustomKeysMapPropagator propagation.TextMapPropagator = &CustomKeys{}
Functions ¶
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 (c *CustomKeys) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context
func (*CustomKeys) Inject ¶
func (c *CustomKeys) Inject(ctx context.Context, carrier propagation.TextMapCarrier)
type GrpcHeaderCarrier ¶
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.
Click to show internal directories.
Click to hide internal directories.