Skip to content

Commit a780eeb

Browse files
committed
chore: update README
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
1 parent 0a7371a commit a780eeb

1 file changed

Lines changed: 46 additions & 10 deletions

File tree

README.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,65 @@
1616

1717
# RoadRunner API
1818

19-
To install and use generated packages:
19+
This repository contains the **Protocol Buffer definitions** for [RoadRunner](https://roadrunner.dev). These protos are used for external integrations (RPC) and internal communications between RoadRunner plugins.
20+
21+
Generated Go code lives in a separate repository: [`roadrunner-server/api-go`](https://github.com/roadrunner-server/api-go).
22+
23+
## Repository structure
24+
25+
```
26+
roadrunner/api/ — RoadRunner proto definitions (jobs, kv, http, status, etc.)
27+
third_party/api/ — Temporal API submodule (used as a proto dependency)
28+
buf.yaml — Buf module configuration
29+
buf.gen.yaml — Buf code generation configuration
30+
```
31+
32+
## Using generated Go packages
33+
34+
Install a package from the [`api-go`](https://github.com/roadrunner-server/api-go) repository:
2035
```bash
21-
go get github.com/roadrunner-server/api/v4/build/<API_NAME>/v1
36+
go get github.com/roadrunner-server/api-go/v5/build/<module>/<version>
2237
```
2338

24-
The Proto API is used for external integrations, mostly for RPC or as internal communications. For example:
39+
Example usage:
2540
```go
2641
package foo
2742

2843
import (
29-
jobsv1 "github.com/roadrunner-server/api/v4/build/jobs/v1"
44+
jobsv1 "github.com/roadrunner-server/api-go/v5/build/jobs/v1"
3045
)
3146

3247
func Push(in *jobsv1.PushRequest, out *jobsv1.Empty) error {
3348
return nil
3449
}
3550
```
3651

37-
# Centrifugal API
38-
- [API](https://github.com/centrifugal/centrifugo/blob/master/internal/apiproto/api.proto)
39-
- [Proxy](https://github.com/centrifugal/centrifugo/blob/master/internal/proxyproto/proxy.proto)
52+
## Auto-generation
53+
54+
Pushing to `master` in this repo triggers a GitHub Actions workflow in [`api-go`](https://github.com/roadrunner-server/api-go) that:
55+
1. Pulls the latest proto definitions via a git submodule.
56+
2. Runs `buf generate` to produce Go code.
57+
3. Commits and pushes the result.
58+
59+
You do not need to run code generation manually — CI handles it automatically.
4060

41-
# Building API
61+
## Local development
4262

43-
- Install buf: `go install github.com/bufbuild/buf/cmd/buf@latest`.
44-
- In the repository root run: `buf generate --debug`
63+
Install [Buf](https://buf.build/docs/installation):
64+
```bash
65+
go install github.com/bufbuild/buf/cmd/buf@latest
66+
```
67+
68+
Lint proto files:
69+
```bash
70+
buf lint
71+
```
72+
73+
Generate code locally (output goes to `build/`):
74+
```bash
75+
buf generate
76+
```
77+
78+
## Centrifugal API
79+
- [API](https://github.com/centrifugal/centrifugo/blob/master/internal/apiproto/api.proto)
80+
- [Proxy](https://github.com/centrifugal/centrifugo/blob/master/internal/proxyproto/proxy.proto)

0 commit comments

Comments
 (0)