Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fullstorydev/grpchan
Channels for gRPC: custom transports
https://github.com/fullstorydev/grpchan
golang grpc
Last synced: 6 days ago
JSON representation
Channels for gRPC: custom transports
- Host: GitHub
- URL: https://github.com/fullstorydev/grpchan
- Owner: fullstorydev
- License: mit
- Created: 2018-02-17T16:22:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-15T14:48:39.000Z (18 days ago)
- Last Synced: 2025-01-20T10:02:49.564Z (13 days ago)
- Topics: golang, grpc
- Language: Go
- Homepage:
- Size: 196 KB
- Stars: 209
- Watchers: 25
- Forks: 23
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-grpc - grpchan - Channels for gRPC: custom transports, such as in-process and HTTP 1.1 (Language-Specific / Go)
README
# gRPC Channels
[![Build Status](https://circleci.com/gh/fullstorydev/grpchan/tree/master.svg?style=svg)](https://circleci.com/gh/fullstorydev/grpchan/tree/master)
[![Go Report Card](https://goreportcard.com/badge/github.com/fullstorydev/grpchan)](https://goreportcard.com/report/github.com/fullstorydev/grpchan)
[![GoDoc](https://godoc.org/github.com/fullstorydev/grpchan?status.svg)](https://godoc.org/github.com/fullstorydev/grpchan)This repo provides an abstraction for an RPC connection: the `Channel`.
Implementations of `Channel` can provide alternate transports -- different
from the standard HTTP/2-based transport provided by the `google.golang.org/grpc`
package.This can be useful for providing new transports, such as HTTP 1.1, web sockets,
or (significantly) in-process channels for testing.This repo also contains two such alternate transports: an HTTP 1.1 implementation
of gRPC (which supports all stream kinds other than full-duplex bidi streams) and
an in-process transport (which allows a process to dispatch handlers implemented
in the same program without needing serialize and de-serialize messages over the
loopback network interface).In order to use channels with your proto-defined gRPC services, you need to use a
protoc plugin included in this repo: `protoc-gen-grpchan`.```bash
go install github.com/fullstorydev/grpchan/cmd/protoc-gen-grpchan
```You use the plugin via a `--grpchan_out` parameter to protoc. Specify the same
output directory to this parameter as you supply to `--go_out`. The plugin will
then generate `*.pb.grpchan.go` files, alongside the `*.pb.go` files. These
additional files contain additional methods that let you use the proto-defined
service methods with alternate transports.```go
//go:generate protoc --go_out=plugins=grpc:. --grpchan_out=. my.proto
```