Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GRPCConnection ¶
type GRPCConnection struct {
Addr string
Conn *grpc.ClientConn
Logger libLog.Logger
}
GRPCConnection is a struct which deal with gRPC connections.
func (*GRPCConnection) Connect ¶
func (c *GRPCConnection) Connect() error
Connect keeps a singleton connection with gRPC.
func (*GRPCConnection) ContextMetadataInjection ¶
func (c *GRPCConnection) ContextMetadataInjection(ctx context.Context, token string) context.Context
ContextMetadataInjection injects OpenTelemetry trace context and request-scoped metadata into the outgoing gRPC context. It preserves existing metadata and appends: - traceparent/tracestate (W3C propagated via OpenTelemetry) - metadata_id (request correlation id) - authorization (JWT), when provided
func (*GRPCConnection) GetNewClient ¶
func (c *GRPCConnection) GetNewClient() (*grpc.ClientConn, error)
GetNewClient returns a connection to gRPC, reconnect it if necessary.
Click to show internal directories.
Click to hide internal directories.