GitXplorerGitXplorer
j

goprotoc

public
85 stars
8 forks
3 issues

Commits

List of commits on branch master.
Verified
075a17db1f52b5bbea2b5b619f9363a5f7692d93

replace travis w/ circle CI in badges

jjhump committed 3 years ago
Verified
a70e528b4997f4793bf8b977476283217050d9a3

supported features (#40)

jjhump committed 3 years ago
Verified
70c8197ef4ea66d11022326b63050f6fa10f6b29

add support for newer ServiceDesc var, generated by newer protoc-gen-go-grpc (#38)

jjhump committed 4 years ago
Verified
8e9b279fcbe01d8842b205b1a843d447e18594b3

support more options in GoNames, to match recent options in protoc-gen-go (#36)

jjhump committed 4 years ago
Verified
9543606b7dbfca97b81fbe0197fa31df972de200

add ability for wrapper program to add in-process plugin implementations (#35)

jjhump committed 4 years ago
Verified
2acce43eae6e6101cc80b78a539cf97ba0ece553

stop using github.com/golang/protobuf/protoc-gen-go/generator (#34)

jjhump committed 4 years ago

README

The README file for this repository.

Go-protoc

Build Status Go Report Card GoDoc

This repo makes it easy to work in the protobuf tool chain using Go.

Writing Plugins for protoc

First and foremost, the included plugins package makes it easy to implement protoc plugins in Go. It defines an interface that plugins implement as well as facilities to actually integrate with protoc (e.g. implementing the proper plugin protocol). It also provides "name resolution" logic: computing qualified names in Go source code for elements in proto descriptors. This makes it a snap to write plugins in Go that generate additional Go code from your proto sources.

Pure Go version of protoc

This repo also contains a pure-Go re-implementation of protoc. This new version of protoc, named goprotoc (of course!), will delegate to a protoc executable on the path, driving it as if it were a plugin, for generating C++, C#, Objective-C, Java, JavaScript, Python, PHP, and Ruby code (since they are implemented in protoc itself). But it provides descriptors to protoc, parsed by goprotoc, instead of having protoc re-parse all of the source code. And it can invoke any other plugins (such as protoc-gen-go) the same way that protoc would.

In addition to the goprotoc command, this repo provides a package that other Go programs can use as the entry-point to running Protocol Buffer code gen, without having to shell out to an external program.

Extras

You'll also find a protoc plugin named protoc-gen-gox that can be the entry point for generating Go code. It will delegate to protoc-gen-go for standard code gen and gRPC code gen, but it can also be configured to execute other plugins that emit additional Go code. It's sort of like a plugin multiplexer that supports a configuration file for enabling and configuring the various plugins that it invokes.