mgrpc

package
v3.4.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapAuthGRPCError

func MapAuthGRPCError(ctx context.Context, err error, code, title, operation string) error

MapAuthGRPCError maps gRPC auth errors to domain errors and logs raw details. Returns the original error when it isn't an auth error.

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 optional authorization into the outgoing gRPC context. It preserves existing metadata and appends: - traceparent/tracestate (W3C propagated via OpenTelemetry) - authorization (JWT), when provided

func (*GRPCConnection) GetNewClient

func (c *GRPCConnection) GetNewClient() (*grpc.ClientConn, error)

GetNewClient returns a connection to gRPC, reconnect it if necessary.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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