-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Valery Piashchynski <[email protected]>
- Loading branch information
Showing
1 changed file
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,54 @@ | ||
# api | ||
RR plugins and gRPC api | ||
<p align="center"> | ||
<img src="https://user-images.githubusercontent.com/796136/50286124-6f7f3780-046f-11e9-9f45-e8fedd4f786d.png" height="75px" alt="RoadRunner"> | ||
</p> | ||
<p align="center"> | ||
<a href="https://packagist.org/packages/spiral/roadrunner"><img src="https://poser.pugx.org/spiral/roadrunner/version"></a> | ||
<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> | ||
<a href="https://github.com/roadrunner-server/api/actions"><img src="https://github.com/roadrunner-server/api/workflows/Linters/badge.svg" alt=""></a> | ||
<a href="https://goreportcard.com/report/github.com/roadrunner-server/api"><img src="https://goreportcard.com/badge/github.com/roadrunner-server/api"></a> | ||
<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> | ||
<a href="https://discord.gg/TFeEmCs"><img src="https://img.shields.io/badge/discord-chat-magenta.svg"></a> | ||
</p> | ||
|
||
# RoadRunner API | ||
|
||
RR API consists of 2 parts: | ||
|
||
1. Plugin interfaces. | ||
2. Proto API for the PHP clients, at the moment released as **V1Beta**. | ||
|
||
Plugins should depend only on this repo, but not on each other. For example: | ||
|
||
```go | ||
package foo | ||
|
||
import ( | ||
"github.com/roadrunner-server/api/v2/plugins/config" | ||
) | ||
|
||
type Plugin struct {} | ||
|
||
func (p *Plugin) Init(cfg config.Configurer) error { | ||
return nil | ||
} | ||
``` | ||
|
||
Here as you see, our `package foo` depends only on the `api` repository, thus you can easily switch between implementations. | ||
|
||
--- | ||
|
||
Proto API used for the external integrations for the RPC (mostly) or as the internal communications. For example: | ||
|
||
```go | ||
package foo | ||
|
||
import ( | ||
jobsv1beta "github.com/roadrunner-server/api/v2/proto/jobs/v1beta" | ||
) | ||
|
||
func Push(in *jobsv1beta.PushRequest, out *jobsv1beta.Empty) error { | ||
return nil | ||
} | ||
``` | ||
|
||
Here is the method used in the RR to accept the `Job` from the external system. |