https://github.com/borud/chat
Minimal example of repository that uses buf.build's schema registry.
https://github.com/borud/chat
Last synced: 4 months ago
JSON representation
Minimal example of repository that uses buf.build's schema registry.
- Host: GitHub
- URL: https://github.com/borud/chat
- Owner: borud
- Created: 2022-01-05T16:17:52.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-27T16:52:38.000Z (over 4 years ago)
- Last Synced: 2025-07-26T11:35:27.835Z (11 months ago)
- Language: Makefile
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chat
This is a minimal example of using the [buf.build](https://buf.build) *Buf Schema Registry* (BSR) to maintain a protobuffer and/or gRPC API. This
example is going to evolve a bit as I learn more about how to use *buf.build*, but we are going to try to keep it minimal.
You can find this on
## Prerequisites
If you have Go installed and set up correctly on your system. If you have Go installed you can execute the command:
```shell
make dep
```
which will install the latest version of the `buf` command in your `$GOPATH/bin` directory.
If you do not have Go installed you can check out [the installation instructions on](https://docs.buf.build/installation)
## Makefile
In this project we use `make` to automate the various steps (since make is the lowest common denominator of build systems). You can also consider the `Makefile` as a piece of compact documentation if you want to use something else in your project.
## Linting and building
If you just want to run both linting and code generation you can just use the default target in the makefile by running:
```shell
make
```
You can run linting and generation separately by using their own targets:
```shell
make lint
make gen
```
## Check for breakage
To ensure that you do not make changes that break backward compatibility you can use the `breaking` target to check for breakage. This compares the current state of your repository against the main branch on github.
```shell
make breaking
```
## Publishing
In order to publish updates to the BSR you can run
```shell
make publish
```
This runs the breakage check and if this is okay, publishes the result to . Having a breakage check before you publish is a really good idea.
The other build targets are:
## Cleaning up
The code generated in this project (and placed in the `pkg` directory) isn't really used for anything and doesn't get checked in. You want to get this code from the BSR when you use it in a project anyway. This is more to enable you to inspect the result of the code generation.