Categorygithub.com/n-r-w/grpcsrv
repositorypackage
1.0.8
Repository: https://github.com/n-r-w/grpcsrv.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

gRPCsrv

A comprehensive Go framework for building production-ready gRPC services with built-in HTTP gateway support, observability, and best practices.

Go Reference Go Report Card

Key Features

  • 🚀 Simplified gRPC service initialization and configuration
  • 🛡️ Middleware support with interceptors
  • 🌐 Automatic HTTP/REST gateway via grpc-gateway (optional)
  • 💪 Built-in health check endpoints (liveness and readiness probes) (optional)
  • 📊 Integrated observability with OpenTelemetry and Prometheus (optional)
  • 🔄 Automatic recovery handling (optional)
  • 📝 Custom logger (optional)
  • 🛡️ https://github.com/n-r-w/bootstrap integration for graceful shutdowns (optional)

Installation

go get github.com/n-r-w/grpcsrv

Code Generation

1. Install Protocol Buffer Compiler (protoc)

official documentation

2. Install Required Go Protobuf Plugins

# Install protoc-gen-go (generates Go code from .proto files)
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

# Install protoc-gen-go-grpc (generates gRPC service code)
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

# Install protoc-gen-grpc-gateway (generates HTTP/REST gateway)
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest

3. Generate Code from Proto Files

The project uses Task for managing project tasks. To generate the code from Protocol Buffer definitions, first install Task according to the official documentation.

Then run:

task protogen

Usage Example

Health Checks

The framework provides built-in health check endpoints:

  • /liveness - for liveness probe
  • /readiness - for readiness probe

These can be integrated directly into your HTTP handler tree using the IHealther interface.