Categorygithub.com/nhatthm/go-grpc-middleware
modulepackage
0.5.0
Repository: https://github.com/nhatthm/go-grpc-middleware.git
Documentation: pkg.go.dev

# README

Go gRPC Middleware

GitHub Releases Build Status codecov Go Report Card GoDevDoc Donate

gRPC Go Middleware: interceptors, helpers, utilities.

Table of Contents

Prerequisites

  • Go >= 1.19

[table of contents]

Install

go get github.com/nhatthm/go-grpc-middleware

[table of contents]

Interceptors

Ctxd Logger

See bool64/ctxd

  • Server middlewares
    • ctxd.UnaryServerInterceptor
    • ctxd.StreamServerInterceptor
  • Client middlewares
    • ctxd.UnaryClientInterceptor
    • ctxd.StreamClientInterceptor

[table of contents]

Timeout

There are 4 dial options for gRPC client:

  • Sleep for a duration before doing the job.
    timeout.WithStreamClientSleepInterceptor
    timeout.WithUnaryClientSleepInterceptor
  • Automatically creates a new context with given duration if there is none in the current context.
    timeout.WithStreamClientTimeoutInterceptor
    timeout.WithUnaryClientTimeoutInterceptor

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

[table of contents]

Paypal donation

paypal

       or scan this

[table of contents]

# Packages

No description provided by the author
Package timeout provides middlewares for automatically creating context with timeout if it is not set.