Our great sponsors
-
Here is article about create the example of similar to real production mail microservice using RabbitMQ, gRPC, Prometheus, Grafana monitoring and Jaeger opentracing ⚡️ Source code GitHub repository
-
I use Gomail for send emails, of course some SMTP server is required, but you can google many free variants for testing. Send method is very simple:
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
Code for another gRPC methods and some tests you can find in th repository. For testing and mocking i can recomend testify and gomock.
-
And initialize our gRPC service, here i used gRPC Middleware repository for unary interceptors:
-
After successfully send email let's save it in postgres, for sql db is good combination of sqlx and pgx.
-
For testing gRPC we can use evans and need add reflection:
Related posts
- How to get "message-id" sent via net/smtp, SSL?
- [Question] Suggested way to update a database row using gRPC/PostgreSQL (pgx) ?
- What are the most useful packages you know for Go?
- Go Package for better integration tests: github.com/ory/dockertest
- Part-1: Building a basic microservice with gRPC using Golang