package meta import ( "context" "github.com/go-kratos/kratos/v2/metadata" ) const ( XMdGlobalOperator = "x-md-global-operator" XMdGlobalAppid = "x-md-global-appid" XMdServiceName = "x-md-service-name" ) func Set(ctx context.Context, kv ...string) context.Context { return metadata.AppendToClientContext(ctx, kv...) } func Get(ctx context.Context, key string) string { if meta, ok := metadata.FromClientContext(ctx); ok { return meta.Get(key) } return "" }