Central repo to hold all protobuf definitions
This repository uses the Uber Protobuf Styleguide v2.
It's enforced by using uber's prototool which also takes care of creating
and generating the protobuf stubs.
To setup the git-hooks, run ./scripts/install-githooks.sh
from the repository root.
You can remove them by running ./scripts/uninstall-githooks.sh
.
You need to have prototool installed and set-up.
prototool lint
will run the uber2 linter
prototool generate
will generate all protobufs into ./gen/
prototool create godin/<package>/<subpackage>/<version>/<subpackage>.proto
to create a new protobuf file
I highly suggest that you read through the uber styleguide. Even if you do not want to use them, they provide some nice insights and tips which you might find helpful
Currently only Golang is configured, so there is only one automatic repo: lukasjarosch/godin-api-go
To illustrate a general workflow I will use a simple example.
Imagine you want to create a mail
service.
- Create
godin/mail/v1beta1/
folders. Always start out with a beta package first until the API stabilizes. - Generate a protobuf which holds general datastructures like enums (your domain models) using
prototool create godin/mail/v1beta1/mail.proto
- For each service, generate a new proto file. We only want to expos the api using one service, so:
prototool create godin/mail/v1beta1/mail_api.proto
- Define your API, work on the service implementing it, refine the api, ... rinse and repeat
- During that process you might hit on a major breaking change. Maybe that would be a good time to create a
v1beta2
package - goto: 4
- Once your API has stabilized, create a release package
v1
and remove all dependencies to beta packages (the linter will nag at you if you don't) - Your API should now be stable and can be deployed to production