13

GitHub - aperturerobotics/protobuf-project: protobuf-go, vtprotobuf, and grpc/dr...

 2 years ago
source link: https://github.com/aperturerobotics/protobuf-project
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

protobuf-project template

This is a repository template for projects using protobuf.

Uses a Makefile to download tools to ./hack/bin.

Includes targets for linting, checking outdated modules, etc.

You can create a new repository with this template on GitHub.

Makefile

The available make targets are:

  • gengo: Generate protobuf files.
  • test: run go test -v ./...
  • lint: run golangci-lint on the project.
  • fix: run golangci-lint --fix on the project.
  • list: list go module dependencies
  • outdated: list outdated go module dependencies

Branches

Other available branches:

  • twirp: uses the twirp rpc library instead of grpc.
  • drpc: uses the drpc rpc library instead of grpc.

Usage

Protobuf imports use Go paths and package names:

syntax = "proto3";
package example;

import "github.com/aperturerobotics/controllerbus/controller/controller.proto";

// GetBusInfoResponse is the response type for GetBusInfo.
message GetBusInfoResponse {
  // RunningControllers is the list of running controllers.
  repeated controller.Info running_controllers = 1;
}

To generate the protobuf files:

$ git add -A
$ make gengo

The Makefile will download the tools using Go to a bin dir.

Support

protobuf-project is supported by Aperture Robotics, LLC.

Community contributions and discussion are welcomed!

Please open a GitHub issue with any questions / issues.

... or feel free to reach out on Matrix Chat or Discord.

License


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK