middleware

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 11 Imported by: 0

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.

Jump to

Keyboard shortcuts

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