https://github.com/wingkwong/grpc-playground
My gRPC Playground
https://github.com/wingkwong/grpc-playground
gprc learning-playground protobuf3
Last synced: about 1 month ago
JSON representation
My gRPC Playground
- Host: GitHub
- URL: https://github.com/wingkwong/grpc-playground
- Owner: wingkwong
- License: mit
- Created: 2020-05-06T04:55:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:27:06.000Z (over 1 year ago)
- Last Synced: 2025-02-16T03:43:21.885Z (3 months ago)
- Topics: gprc, learning-playground, protobuf3
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gRPC-playground
My gRPC Playground## Define a protocol message
- Name of the message: UpperCamelCase
- Name of the field: lower_snake_case
- Some scalar-value data types:
- string, bool, bytes
- float, double
- int32, int64, unit32, unit64, sint32, sint64, etc.
- Data types can be user-defined enums or other messages
- is an arbitrary interger
- from 1 to 2^29-1
- except from 19,000 to 19,999 (reserved)
- from 1 to 15 take 1 byte
- don't need to be in-order or sequential
- must be unique for same-level fields```
syntax = "proto3"message {
name_of_field_1 = tag_1;
name_of_field_2 = tag_2;
name_of_field_3 = tag_3;
}
```## Install
Install protobuf
```bash
brew install protobuf
```Install gRPC
```bash
export GO111MODULE=on # Enable module-aware mode
go get google.golang.org/[email protected]
```Install ``protoc`` plugin for Go
```bash
go get github.com/golang/protobuf/protoc-gen-go
```Update ``PATH`` so that the ``protoc`` compiler can find the plugin:
```
export PATH="$PATH:$(go env GOPATH)/bin"
```## Generate gPRC Code
```
protoc proto/*.proto --go_out=plugins=grpc:pkg
```