Documentation ¶
Overview ¶
Package grpc_requestlog is a generic server-side gRPC middleware that outputs request log. If the request ID is not specified, it will be automatically generated.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(logger applog.Logger, opt ...Option) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a gRPC middleware that outputs request logs.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an option when creating middleware.
func RequestIDFunc ¶
RequestIDFunc is a function option to automatically generate a request ID when it is not specified. The default is a function that generates a UUID.
func RequestIDKey ¶
RequestIDKey is a key option for the request ID specified in the metadata. The default is "Request-ID".
Click to show internal directories.
Click to hide internal directories.