imposm3/vendor/github.com/gogo/protobuf
Oliver Tonnhofer a5cbe077be update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
..
_conformance update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
codec update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
gogoproto update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
gogoreplace update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
io update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
jsonpb update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
plugin update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
proto update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protobuf update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-gen-combo update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-gen-gofast update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-gen-gogo update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-gen-gogofast update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-gen-gogofaster update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-gen-gogoslick update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-gen-gogotypes update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-gen-gostring update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
protoc-min-version update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
sortkeys update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
test update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
types update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
vanity update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
version update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
.gitignore update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
.mailmap update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
.travis.yml update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
AUTHORS update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
CONTRIBUTORS update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
GOLANG_CONTRIBUTORS update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
LICENSE update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
Makefile update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
README update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
Readme.md update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
bench.md update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
custom_types.md update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
extensions.md update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00
install-protobuf.sh update vendorized dependencies; use dep 2017-11-15 14:18:24 +01:00

Readme.md

Protocol Buffers for Go with Gadgets

Build Status

gogoprotobuf is a fork of golang/protobuf with extra code generation features.

This code generation is used to achieve:

  • fast marshalling and unmarshalling
  • more canonical Go structures
  • goprotobuf compatibility
  • less typing by optionally generating extra helper code
  • peace of mind by optionally generating test and benchmark code
  • other serialization formats

Keeping track of how up to date gogoprotobuf is relative to golang/protobuf is done in this issue

Users

These projects use gogoprotobuf:

Please let us know if you are using gogoprotobuf by posting on our GoogleGroup.

Mentioned

Getting Started

There are several ways to use gogoprotobuf, but for all you need to install go and protoc. After that you can choose:

  • Speed
  • More Speed and more generated code
  • Most Speed and most customization

Installation

To install it, you must first have Go (at least version 1.6.3) installed (see http://golang.org/doc/install). Go 1.8.3 and 1.9 are continuously tested.

Next, install the standard protocol buffer implementation from https://github.com/google/protobuf. Most versions from 2.3.1 should not give any problems, but 2.6.1, 3.0.2 and 3.4.0 are continuously tested.

Speed

Install the protoc-gen-gofast binary

go get github.com/gogo/protobuf/protoc-gen-gofast

Use it to generate faster marshaling and unmarshaling go code for your protocol buffers.

protoc --gofast_out=. myproto.proto

This does not allow you to use any of the other gogoprotobuf extensions.

More Speed and more generated code

Fields without pointers cause less time in the garbage collector. More code generation results in more convenient methods.

Other binaries are also included:

protoc-gen-gogofast (same as gofast, but imports gogoprotobuf)
protoc-gen-gogofaster (same as gogofast, without XXX_unrecognized, less pointer fields)
protoc-gen-gogoslick (same as gogofaster, but with generated string, gostring and equal methods)

Installing any of these binaries is easy. Simply run:

go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/{binary}
go get github.com/gogo/protobuf/gogoproto

These binaries allow you to using gogoprotobuf extensions.

Most Speed and most customization

Customizing the fields of the messages to be the fields that you actually want to use removes the need to copy between the structs you use and structs you use to serialize. gogoprotobuf also offers more serialization formats and generation of tests and even more methods.

Please visit the extensions page for more documentation.

Install protoc-gen-gogo:

go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/jsonpb
go get github.com/gogo/protobuf/protoc-gen-gogo
go get github.com/gogo/protobuf/gogoproto

GRPC

It works the same as golang/protobuf, simply specify the plugin. Here is an example using gofast:

protoc --gofast_out=plugins=grpc:. my.proto