Building a REST microservice with Go Kit

With this knowledge, we are ready to build our first microservice that provides the API for encryption/decryption. We use Go Kit and our encryption utils to write that microservice. As we discussed in the previous section, a Go-Kit microservice should be built in a step-wise manner. To create a service, we need to design a few things upfront. They are:

  • Service implementation
  • Endpoints
  • Request/response models
  • Transport

Sit tight. This terminology seems alien for now. We will be quite comfortable with it soon. Let us create a directory with the following directory structure. Every Go Kit project can be in this project structure. Let us call our project encryptService. Create these files in the same ...

Get Building RESTful Web services with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.