Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInjectServiceContext ¶
func NewInjectServiceContext(conf conf.BootstrapConf) grpc.UnaryServerInterceptor
NewInjectServiceContext 将服务的信息注入到上下文中
func NewServiceAccessLogger ¶
func NewServiceAccessLogger(handle func(b []byte, msg string)) grpc.UnaryServerInterceptor
NewServiceAccessLogger 服务访问日志中间件,一般在NewInjectServiceContext中间件之前使用 handle 接收两类日志:b 为结构化 JSON,msg 为人类可读文本行; 字段包含 path/request/response/duration/status/trace_id 等,便于统一采集。
func PropagateIncomingMetadata ¶
func PropagateIncomingMetadata(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
PropagateIncomingMetadata 将入站元数据传播到出站上下文中
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.