Skip to content

An example gRPC API written in Go that performs calculations on numbers

Notifications You must be signed in to change notification settings

henry-jackson/grpc-calculator-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpc-calculator-server

implements a basic gRPC API server that has unary, server streaming, client streaming, and bidirectional streaming methods along with sample client side code.

How to Run

Assumes you have already installed protoc, grpc-go, the Go language, etc. See this repo for any help.

Server

In one session:

cd calc-server/
go run *.go

Client

Client behavior can be altered by uncommenting certain lines in main() of calc-client/main.go In another session:

cd calc-client/
go run *.go

Examples

See screenshots below for examples (server running on left and client executing requests on right) Note: Some examples were captured when files were named differently. Follow the instructions in the How to Run section for up to date filenames

Unary - Sum two numbers

unary-screenshot

Server streaming - Find prime factors of number

sever-streaming-screenshot

Client streaming - Calculate average of streamed inputs

client-streaming-screenshot

Bidirectional streaming - Find maximum of streamed inputs

bidirectional-streaming-screenshot

About

An example gRPC API written in Go that performs calculations on numbers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published