Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bithavoc/hellogrpcstdin
An example of GRPC Dialing with os.Stdin and os.Stdout of a child process.
https://github.com/bithavoc/hellogrpcstdin
go golang grpc plugins
Last synced: about 13 hours ago
JSON representation
An example of GRPC Dialing with os.Stdin and os.Stdout of a child process.
- Host: GitHub
- URL: https://github.com/bithavoc/hellogrpcstdin
- Owner: bithavoc
- Created: 2018-07-17T00:16:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-05T15:14:01.000Z (over 3 years ago)
- Last Synced: 2023-04-10T03:12:24.547Z (over 1 year ago)
- Topics: go, golang, grpc, plugins
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# GRPC external plugin example
```
go get github.com/bithavoc/hellogrpcstdin
```An example of GRPC Dialing with Stdin and Stdout of a child process.
`greeter_server` launches `greeter_client` as a process and uses `os.Stdin` and `os.Stdout` to listen for GRPC requests.
**Note:** You don't really need this library to implement GRPC plugins in Go, you can always use [hashicorp/go-plugin](https://github.com/hashicorp/go-plugin) which uses unix sockets.
## Running Example
**Compile Client(Plugin):**
```shell
(cd greeter_client; go build)
```**Compile Server(Plugin):**
```shell
(cd greeter_server; go build)
```**Run Server(Plugin):**
```shell
(cd greeter_server; ./greeter_server)
```You should see an output similar to this:
```
Server starting
accepting, waiting for only conn
agent process running, will ready listener
accepting, only conn ready
accepting, waiting for only conn
2018/07/16 19:13:33 Server replying, check greeter_server/client.log
````cat greeter_server/client.log`:
```
2018/07/16 19:15:51 client starting
2018/07/16 19:15:51 addresss
2018/07/16 19:15:51 Greeting: Hello world from server
```