Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.
/ grpc-demo-clients Public archive

Protobuf definitions and generated clients for playing with gRPC.

Notifications You must be signed in to change notification settings

jonkight/grpc-demo-clients

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC Demo Clients

This is a monorepo that contains protobuf definitions and the generated clients for the purpose of a demo.

The intentional workflow for this repository is that a developer will update proto files and create a pull request. The workflow automation will then format the proto files, generate the gRPC stubs, and update the pull request.

This takes the burden of formatting the proto files and generating the stubs away from the developer. It also ensures the code generation commit is separated from the developer commit, making the changes easier to review.

The automation will also check for breaking changes and ensure the style guidelines are upheld (e.g. naming conventions). Ideally a developer could use a web editor to modify this repo safely.

Local Tool Setup

prototool

Working with proto files can be tricky, especially when trying to enforce style guidelines and patterns. Luckily, there's an amazing tool that makes it much easier called prototool. It provides the management of protoc, standardization of building proto files which is enforced by configuration, and more.

The proto files in this repository abide by the Uber v2 Style Guidelines. It's a really well thought out style guide that's hard to mess up.

Configuration is enforced by prototool.yaml files. For details on the supported settings see the docs.

The preferred method of running the prototool is with the docker image. For more installation opions see here.

docker run -v "$(pwd):/work" uber/prototool:latest prototool all

Vim

Vim support is provided by prototool.

Visual Studio Code

Visual Studio Code can be used to edit the protobuf files. However, it cannot enforce the required style guidelines, so it's best to use prototool when developing.

The following extensions can also be used to offer syntax highlighting, autocompletion, and more when using Visual Studio Code.

  • vscode-proto3 - This provides syntax highlighting and code completion. Requires protoc to be in PATH.
  • clang-format - Used to override the default column limit that vscode-proto3 enforces.

About

Protobuf definitions and generated clients for playing with gRPC.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages