Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mg52/go-grpc
https://github.com/mg52/go-grpc
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mg52/go-grpc
- Owner: mg52
- Created: 2022-04-15T12:03:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T16:22:15.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T03:25:57.140Z (5 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-grpc
$ go mod init github.com/mg52/go-grpc
$ go install google.golang.org/protobuf/cmd/[email protected]
$ go install google.golang.org/grpc/cmd/[email protected]
$ export PATH="$PATH:$(go env GOPATH)/bin"
// create grpc-stream/greetpb/greet.proto
$ protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
grpc-stream/greetpb/greet.proto$ go get google.golang.org/grpc
// add sever and client folder and files.
---
// run server in a terminal$ go run grpc-stream/server/server.go
---
// run client in another terminal for server streaming$ go run grpc-stream/client/client.go -o 0 -f name -l lastname
---
// run client in another terminal for client streaming$ go run grpc-stream/client/client.go -o 1