Skip to content

henrikalbihn/go-grpc-pingpong

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-grpc-pingpong 🐹🏓

developer language ci

Description

A simple gRPC boilerplate project in Golang.

As my first foray into gRPC and Golang, I wanted to create a simple server and client. The server will listen for an empty TCP/gRPC message (payload={}) from the client and respond with a Pong message.

Features

  • gRPC server
  • gRPC client
  • gRPC protocol buffer spec
  • gRPC code generation (protoc and protoc-gen-go)
  • gRPC server and client binaries
  • make commands
  • github actions CI/CD pipeline

Usage

Build

# to build the binaries 
make build

Run the Server

# to run the server
make serve
2023/09/07 11:03:02 Starting server on port 50051

Custom Port

# or with a custom port
./bin/serve -port 50000
2023/09/07 11:05:18 Starting server on port 50000

Ping the Server

# in another terminal
make ping
2023/09/07 11:03:04 Establishing gRPC connection - localhost:50051...
2023/09/07 11:03:04 Response: Pong

Custom Port

# or with custom port
./bin/ping -port 50000
2023/09/07 11:03:04 Establishing gRPC connection - localhost:50000...
2023/09/07 11:03:04 Response: Pong

Stop the Server

# in the server terminal
# to stop the server, press Ctrl+C

References

About

A simple gRPC boilerplate project in Golang.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published