Skip to content

Commit 9fbcad5

Browse files
committed
update README
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
1 parent b50b9a2 commit 9fbcad5

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

README.md

+54-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
1-
# api
2-
RR plugins and gRPC api
1+
<p align="center">
2+
<img src="https://user-images.githubusercontent.com/796136/50286124-6f7f3780-046f-11e9-9f45-e8fedd4f786d.png" height="75px" alt="RoadRunner">
3+
</p>
4+
<p align="center">
5+
<a href="https://packagist.org/packages/spiral/roadrunner"><img src="https://poser.pugx.org/spiral/roadrunner/version"></a>
6+
<a href="https://pkg.go.dev/github.com/roadrunner-server/api/v2?tab=doc"><img src="https://godoc.org/github.com/roadrunner-server/api/v2?status.svg"></a>
7+
<a href="https://github.com/roadrunner-server/api/actions"><img src="https://github.com/roadrunner-server/api/workflows/Linters/badge.svg" alt=""></a>
8+
<a href="https://goreportcard.com/report/github.com/roadrunner-server/api"><img src="https://goreportcard.com/badge/github.com/roadrunner-server/api"></a>
9+
<a href="https://lgtm.com/projects/g/roadrunner-server/api/alerts/"><img alt="Total alerts" src="https://img.shields.io/lgtm/alerts/g/roadrunner-server/api.svg?logo=lgtm&logoWidth=18"/></a>
10+
<a href="https://discord.gg/TFeEmCs"><img src="https://img.shields.io/badge/discord-chat-magenta.svg"></a>
11+
</p>
12+
13+
# RoadRunner API
14+
15+
RR API consists of 2 parts:
16+
17+
1. Plugin interfaces.
18+
2. Proto API for the PHP clients, at the moment released as **V1Beta**.
19+
20+
Plugins should depend only on this repo, but not on each other. For example:
21+
22+
```go
23+
package foo
24+
25+
import (
26+
"github.com/roadrunner-server/api/v2/plugins/config"
27+
)
28+
29+
type Plugin struct {}
30+
31+
func (p *Plugin) Init(cfg config.Configurer) error {
32+
return nil
33+
}
34+
```
35+
36+
Here as you see, our `package foo` depends only on the `api` repository, thus you can easily switch between implementations.
37+
38+
---
39+
40+
Proto API used for the external integrations for the RPC (mostly) or as the internal communications. For example:
41+
42+
```go
43+
package foo
44+
45+
import (
46+
jobsv1beta "github.com/roadrunner-server/api/v2/proto/jobs/v1beta"
47+
)
48+
49+
func Push(in *jobsv1beta.PushRequest, out *jobsv1beta.Empty) error {
50+
return nil
51+
}
52+
```
53+
54+
Here is the method used in the RR to accept the `Job` from the external system.

0 commit comments

Comments
 (0)