Skip to content

yolkhovyy/go-grpc

 
 

Repository files navigation

Golang gRPC Demo

Forked from here

Content

  • api/ - gRPC service definition for a voting service, contains RPCs for creating, listing and voting on voteable items
  • cmd/main.go & service/service.go - service implementation
  • config/config.go - service configuration
  • telemetry - metrics, tracing and profiling
  • docker-compose.yml - for running Amazon DynamoDB locally

Running

Install

Clone

git clone git@github.com:yolkhovyy/golang-grpc-demo.git

Start

$ ./start.sh
{"level":"info","time":"2022-08-02T11:29:03+02:00","message":"configuration loaded"}                                                                          
{"level":"info","service":"ggd","time":"2022-08-02T11:29:03+02:00","time":"2022-08-02T11:29:03+02:00","message":"AWS session created"}
...

Send messages

In the second shell

$ ./send.sh
{
  "uuid": "aa271b8e-1245-11ed-8692-02426fbaa4b9"
}
{
  "uuid": "aa2df569-1245-11ed-8692-02426fbaa4b9"
}
...

Test

In the second shell

$ go test -v -count=1 ./...
=== RUN   TestVotingServiceBasic
--- PASS: TestVotingServiceBasic (0.10s)
=== RUN   TestVotingServicePaging
--- PASS: TestVotingServicePaging (0.28s)
PASS
ok      github.com/yolkhovyy/golang-grpc-demo/service   0.407s

Stop

./stop.sh

About

SportBuff Golang Technical Task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.5%
  • Shell 2.5%