Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Jan 21, 2022
1 parent b50b9a2 commit 9fbcad5
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions README.md
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.

0 comments on commit 9fbcad5

Please sign in to comment.