grpcsrv

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderRequestID = "x-request-id"
	// RequestIDKey is the key that holds the unique request ID in a request context.
	RequestIDKey ctxKeyRequestID = 0
)

Variables

This section is empty.

Functions

func InterceptorLogger

func InterceptorLogger() logging.Logger

func NewCarrier

func NewCarrier(logger *slog.Logger) stats.Handler

func NewGRPCServ

func NewGRPCServ(lc fx.Lifecycle, opt Option, logger *slog.Logger) grpc.ServiceRegistrar

func PanicRecoveryHandler

func PanicRecoveryHandler(ctx context.Context, p any) error

Types

type Carrier

type Carrier struct {
	// contains filtered or unexported fields
}

func (*Carrier) HandleConn

func (ca *Carrier) HandleConn(ctx context.Context, cs stats.ConnStats)

func (*Carrier) HandleRPC

func (ca *Carrier) HandleRPC(ctx context.Context, rs stats.RPCStats)

func (*Carrier) TagConn

func (ca *Carrier) TagConn(ctx context.Context, conn *stats.ConnTagInfo) context.Context

func (*Carrier) TagRPC

func (ca *Carrier) TagRPC(ctx context.Context, rpc *stats.RPCTagInfo) context.Context

type Option

type Option struct {
	Addr string `json:"addr" toml:"addr" yaml:"addr"`
}

Jump to

Keyboard shortcuts

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