protobuf
moduleThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
README¶
Go support for Protocol Buffers
This module(github.com/golang/protobuf)contains Go bindings for protocol buffers.
It has been superseded by thegoogle.golang.org/protobufmodule, which contains an updated and simplified API,support for protobuf reflection, and many other improvements.We recommend that new code use thegoogle.golang.org/protobuf module.
Versions v1.4 and later ofgithub.com/golang/protobuf are implementedin terms ofgoogle.golang.org/protobuf.Programs which use both modules must use at least version v1.4 of this one.
See thedeveloper guide for protocol buffers in Gofor a general guide for how to get started using protobufs in Go.
Seerelease note documentationfor more information about individual releases of this project.
Seedocumentation for the next major revisionfor more information about the purpose, usage, and history of this project.
Package index
Summary of the packages provided by this module:
proto: Packageprotoprovides functions operating on protobuf messages such as cloning,merging, and checking equality, as well as binary serialization and textserialization.jsonpb: Packagejsonpbserializes protobuf messages as JSON.ptypes: Packageptypesprovides helper functionality for protobuf well-known types.ptypes/any:Packageanyis the generated package forgoogle/protobuf/any.proto.ptypes/empty:Packageemptyis the generated package forgoogle/protobuf/empty.proto.ptypes/timestamp:Packagetimestampis the generated package forgoogle/protobuf/timestamp.proto.ptypes/duration:Packagedurationis the generated package forgoogle/protobuf/duration.proto.ptypes/wrappers:Packagewrappersis the generated package forgoogle/protobuf/wrappers.proto.ptypes/struct:Packagestructpbis the generated package forgoogle/protobuf/struct.proto.protoc-gen-go/descriptor:Packagedescriptoris the generated package forgoogle/protobuf/descriptor.proto.protoc-gen-go/plugin:Packagepluginis the generated package forgoogle/protobuf/compiler/plugin.proto.protoc-gen-go:Theprotoc-gen-gobinary is a protoc plugin to generate a Go protocolbuffer package.
Reporting issues
The issue tracker for this projectis located here.
Please report any issues with a sufficient description of the bug or featurerequest. Bug reports should ideally be accompanied by a minimal reproduction ofthe issue. Irreproducible bugs are difficult to diagnose and fix (and likely tobe closed after some period of time). Bug reports must specify the version oftheGo protocol buffer moduleand also the version of theprotocol buffer toolchainbeing used.
Contributing
This project is open-source and accepts contributions. See thecontribution guidefor more information.
Compatibility
This module and the generated code are expected to be stable over time. However,we reserve the right to make breaking changes without notice for the followingreasons:
- Security: A security issue in the specification or implementation maycome to light whose resolution requires breaking compatibility. We reservethe right to address such issues.
- Unspecified behavior: There are some aspects of the protocol bufferspecification that are undefined. Programs that depend on unspecifiedbehavior may break in future releases.
- Specification changes: It may become necessary to address aninconsistency, incompleteness, or change in the protocol bufferspecification, which may affect the behavior of existing programs. Wereserve the right to address such changes.
- Bugs: If a package has a bug that violates correctness, a programdepending on the buggy behavior may break if the bug is fixed. We reservethe right to fix such bugs.
- Generated additions: We reserve the right to add new declarations togenerated Go packages of
.protofiles. This includes declared constants,variables, functions, types, fields in structs, and methods on types. Thismay break attempts at injecting additional code on top of what is generatedbyprotoc-gen-go. Such practice is not supported by this project. - Internal changes: We reserve the right to add, modify, and removeinternal code, which includes all unexported declarations, the
generatorpackage, and all packages underinternal.
Any breaking changes outside of these will be announced 6 months in advance toprotobuf@googlegroups.com.
Directories¶
| Path | Synopsis |
|---|---|
Package descriptor provides functions for obtaining the protocol buffer descriptors of generated Go types. | Package descriptor provides functions for obtaining the protocol buffer descriptors of generated Go types. |
internal | |
cmd/generate-aliascommand | |
gengogrpc Package gengogrpc contains the gRPC code generator. | Package gengogrpc contains the gRPC code generator. |
Package jsonpb provides functionality to marshal and unmarshal between a protocol buffer message and JSON. | Package jsonpb provides functionality to marshal and unmarshal between a protocol buffer message and JSON. |
Package proto provides functionality for handling protocol buffer messages. | Package proto provides functionality for handling protocol buffer messages. |
protoc-gen-go is a plugin for the Google protocol buffer compiler to generate Go code. | protoc-gen-go is a plugin for the Google protocol buffer compiler to generate Go code. |
generator Package generator is deprecated. | Package generator is deprecated. |
generator/internal/remap Package remap handles tracking the locations of Go tokens in a source text across a rewrite by the Go formatter. | Package remap handles tracking the locations of Go tokens in a source text across a rewrite by the Go formatter. |
grpc Package grpc is deprecated. | Package grpc is deprecated. |
Package ptypes provides functionality for interacting with well-known types. | Package ptypes provides functionality for interacting with well-known types. |