A minimal but complete example of using buf with bazel via rules_buf.
We generate the files using buf directly, this lets us use remote plugins and managed mode. We can do so from within bazel:
bazel run @rules_buf_toolchains//:buf -- generateEverytime we generate the files we can run, gazelle to auto generate the BUILD files:
bazel run //:gazelleThis will generate the language rules based on the configured gazelle plugins.
The server can be started using bazel run //cmd/echo:echo and we can use buf curl to test:
buf curl http://localhost:8080/echo.v1.EchoService/Echo --schema