Documentation ¶
Overview ¶
Package middleware contains middlewares for gRPC unknown handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chain ¶
func Chain(base grpc.StreamHandler, mws ...Middleware) grpc.StreamHandler
Chain is a chain of middlewares.
func Log ¶
func Log(debug bool) func(next grpc.StreamHandler) grpc.StreamHandler
Log logs the gRPC requests.
func Recoverer ¶
func Recoverer(next grpc.StreamHandler) grpc.StreamHandler
Recoverer is a middleware that recovers from panics, logs the panic and returns a gRPC error if possible.
Types ¶
type Middleware ¶
type Middleware func(grpc.StreamHandler) grpc.StreamHandler
Middleware is a function that intercepts the execution of a gRPC handler.
func AppInfo ¶
func AppInfo(app, author, version string) Middleware
AppInfo adds the app info to the header metadata.
Click to show internal directories.
Click to hide internal directories.