Skip to content

rmorison/protobuf-toolchain-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build template for Protobuf based applications

Tl;dr

With go version >= 1.20 installed (The g Go version manager recommended)...

Linux

git clone [email protected]:rmorison/protobuf-toolchain-template.git
make
./greeter_server/main &
./greeter_client/main
./greeter_client/main --name everybody

OSX ARM-based (M1, ...)

git clone [email protected]:rmorison/protobuf-toolchain-template.git
make PROTOC_ARCH=osx-aarch
./greeter_server/main &
./greeter_client/main
./greeter_client/main --name everybody

OSX x86-based

git clone [email protected]:rmorison/protobuf-toolchain-template.git
make PROTOC_ARCH=osx-x86_64
./greeter_server/main &
./greeter_client/main
./greeter_client/main --name everybody

Customizing for your project

  1. Replace GO_PACKAGE in Makefile with your package path.
  2. Add your .proto files like proto/myproto/myproto.proto and set option go_package appropriately. (See helloworld.proto for example.)
  3. Update PROTO_FILES with a list of paths to your .proto files.
  4. Replace all targets in Makefile with what you're building. [I like to construct CLI apps with Cobra, though this template does not take that approach as the client and server code comes from the grpc-go helloworld example].

About

Makefile based Protobuf build that versions the ~protoc~ compiler and any plugins

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published