Discover Packages
github.com/cybersamx/go-recipes/grpc/hello-world
command
module
Version:
v0.0.0-...-838b099
Opens a new window with list of versions in this module.
Published: Oct 3, 2023
License: MIT
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
gRPC Hello World
An example of a gRPC client and a server. It is a modification of the official gRPC example .
Setup
Install protobuf compiler and the plugin for Go.
$ brew install protobuf
$ go install github.com/golang/protobuf/protoc-gen-go@latest
$ # Run the following if you haven't done so already.
$ export PATH="$PATH:$(go env GOPATH)/bin"
Generate code from the protobuf definition file.
$ mkdir hello
$ protoc -I . hello.proto --go_out=plugins=grpc:$(PROTO_DIR) \
--go_opt=paths=source_relative
Run both server and client concurrently.
$ go run main.go
You can also run the following command that combines previous steps.
$ make run
Reference and Credits
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.