Categorygithub.com/msharbaji/grpc-go-example
repositorypackage
0.0.0-20231215102654-09afba12a628
Repository: https://github.com/msharbaji/grpc-go-example.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

grpc-go-example Go Reference Continuous Integration Go Report Card

This is an example repository showcasing the usage of gRPC with Go, including server and client implementations.

Environment variables

The following environment variables can be used to configure the application:

NameDescriptionDefaultRequired
GRPC_ENDPOINTgrpc server endpointlocalhost:50051false
KEY_IDhmac key id1false
SECRET_KEYhmac secret key123456false

Set environment variables

export GRPC_ENDPOINT=localhost:50051
export KEY_ID=my-key-id
export SECRET_KEY=my-secret-key

Generate proto code

You can generate the protobuf code using one of the following methods:

Using go generate

go generate ./...

Using protoc

protoc \
     -I=./api/proto \
     --go_out=. \
     --go_opt=module=github.com/msharbaji/grpc-go-example \
     --go-grpc_out=. \
     --go-grpc_opt=module=github.com/msharbaji/grpc-go-example \
     ./api/proto/v1/*.proto

Using buf.build

buf generate

Run server

To run the server, execute the following command:

make run-server