example-grpc-crud-service

module
v0.0.0-...-19b20d4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT

README

example-grpc-crud-service

A sample gRPC service in Go, focused on CRUD (Create, Read, Update, Delete) operations for book management. This project serves as a detailed example of implementing a gRPC service, showcasing the power and efficiency of gRPC for building microservices and distributed systems.

motivation

The creation of example-grpc-crud-service stems from the desire to bridge the gap between basic tutorials and real-world applications in the realm of gRPC services. Many available resources only cover the surface-level aspects of gRPC, leaving out the intricacies involved in setting up a full-fledged service. This project aims to fill this void by offering a near-production-ready template that demonstrates the practical implementation of a gRPC service in Go.

key features

running it

make run PORT=<port>
available operations

For client examples, check examples/client folder.

I'm using Postman in these examples.

create book

create_book

update book

update_book

get book

get_book

get all books

get_all_books

delete book

delete_book

running tests

make test

coverage report

make coverage

compiling proto file

Instead of invoking local protoc compiler, I'm using a Docker image.

make proto

Directories

Path Synopsis
api
db
examples
Package mapper provides functions to convert between gRPC data models and database models for book entities.
Package mapper provides functions to convert between gRPC data models and database models for book entities.

Jump to

Keyboard shortcuts

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