Documentation ¶
Overview ¶
protoc-gen-go is a plugin for the Google protocol buffer compiler to generate Go code. Install it by building this program and making it accessible within your PATH with the name:
protoc-gen-go
The 'go' suffix becomes part of the argument for the protocol compiler, such that it can be invoked as:
protoc --go_out=paths=source_relative:. path/to/file.proto
This generates Go bindings for the protocol buffer defined by file.proto. With that input, the output will be written to:
path/to/file.pb.go
See the README and documentation for protocol buffers to learn more:
https://developers.google.com/protocol-buffers/
Directories ¶
Path | Synopsis |
---|---|
gpb
|
|
cmd/protoc-gen-go
The protoc-gen-go binary is a protoc plugin to generate Go code for both proto2 and proto3 versions of the protocol buffer language.
|
The protoc-gen-go binary is a protoc plugin to generate Go code for both proto2 and proto3 versions of the protocol buffer language. |
cmd/protoc-gen-go/internal_gengo
Package internal_gengo is internal to the protobuf module.
|
Package internal_gengo is internal to the protobuf module. |
compiler/protogen
Package protogen provides support for writing protoc plugins.
|
Package protogen provides support for writing protoc plugins. |
encoding/protojson
Package protojson marshals and unmarshals protocol buffer messages as JSON format.
|
Package protojson marshals and unmarshals protocol buffer messages as JSON format. |
encoding/prototext
Package prototext marshals and unmarshals protocol buffer messages as the textproto format.
|
Package prototext marshals and unmarshals protocol buffer messages as the textproto format. |
encoding/protowire
Package protowire parses and formats the raw wire encoding.
|
Package protowire parses and formats the raw wire encoding. |
internal/descfmt
Package descfmt provides functionality to format descriptors.
|
Package descfmt provides functionality to format descriptors. |
internal/descopts
Package descopts contains the nil pointers to concrete descriptor options.
|
Package descopts contains the nil pointers to concrete descriptor options. |
internal/detrand
Package detrand provides deterministically random functionality.
|
Package detrand provides deterministically random functionality. |
internal/encoding/defval
Package defval marshals and unmarshals textual forms of default values.
|
Package defval marshals and unmarshals textual forms of default values. |
internal/encoding/messageset
Package messageset encodes and decodes the obsolete MessageSet wire format.
|
Package messageset encodes and decodes the obsolete MessageSet wire format. |
internal/encoding/tag
Package tag marshals and unmarshals the legacy struct tags as generated by historical versions of protoc-gen-go.
|
Package tag marshals and unmarshals the legacy struct tags as generated by historical versions of protoc-gen-go. |
internal/encoding/text
Package text implements the text format for protocol buffers.
|
Package text implements the text format for protocol buffers. |
internal/errors
Package errors implements functions to manipulate errors.
|
Package errors implements functions to manipulate errors. |
internal/filedesc
Package filedesc provides functionality for constructing descriptors.
|
Package filedesc provides functionality for constructing descriptors. |
internal/filetype
Package filetype provides functionality for wrapping descriptors with Go type information.
|
Package filetype provides functionality for wrapping descriptors with Go type information. |
internal/flags
Package flags provides a set of flags controlled by build tags.
|
Package flags provides a set of flags controlled by build tags. |
internal/genid
Package genid contains constants for declarations in descriptor.proto and the well-known types.
|
Package genid contains constants for declarations in descriptor.proto and the well-known types. |
internal/msgfmt
Package msgfmt implements a text marshaler combining the desirable features of both the JSON and proto text formats.
|
Package msgfmt implements a text marshaler combining the desirable features of both the JSON and proto text formats. |
internal/order
Package order provides ordered access to messages and maps.
|
Package order provides ordered access to messages and maps. |
internal/pragma
Package pragma provides types that can be embedded into a struct to statically enforce or prevent certain language properties.
|
Package pragma provides types that can be embedded into a struct to statically enforce or prevent certain language properties. |
internal/protobuild
Package protobuild constructs messages.
|
Package protobuild constructs messages. |
internal/protolegacy
Package protolegacy is a stub version of the v1 proto package to satisfy internal/testprotos/legacy dependencies.
|
Package protolegacy is a stub version of the v1 proto package to satisfy internal/testprotos/legacy dependencies. |
internal/set
Package set provides simple set data structures for uint64s.
|
Package set provides simple set data structures for uint64s. |
internal/strs
Package strs provides string manipulation functionality specific to protobuf.
|
Package strs provides string manipulation functionality specific to protobuf. |
internal/version
Package version records versioning information about this module.
|
Package version records versioning information about this module. |
internal/weakdeps
Package weakdeps exists to add weak module dependencies.
|
Package weakdeps exists to add weak module dependencies. |
proto
Package proto provides functions operating on protocol buffer messages.
|
Package proto provides functions operating on protocol buffer messages. |
reflect/protodesc
Package protodesc provides functionality for converting FileDescriptorProto messages to/from protoreflect.FileDescriptor values.
|
Package protodesc provides functionality for converting FileDescriptorProto messages to/from protoreflect.FileDescriptor values. |
reflect/protoreflect
Package protoreflect provides interfaces to dynamically manipulate messages.
|
Package protoreflect provides interfaces to dynamically manipulate messages. |
reflect/protoregistry
Package protoregistry provides data structures to register and lookup protobuf descriptor types.
|
Package protoregistry provides data structures to register and lookup protobuf descriptor types. |
runtime/protoiface
Package protoiface contains types referenced or implemented by messages.
|
Package protoiface contains types referenced or implemented by messages. |
runtime/protoimpl
Package protoimpl contains the default implementation for messages generated by protoc-gen-go.
|
Package protoimpl contains the default implementation for messages generated by protoc-gen-go. |
types/dynamicpb
Package dynamicpb creates protocol buffer messages using runtime type information.
|
Package dynamicpb creates protocol buffer messages using runtime type information. |
types/known/anypb
Package anypb contains generated types for google/protobuf/any.proto.
|
Package anypb contains generated types for google/protobuf/any.proto. |
types/known/durationpb
Package durationpb contains generated types for google/protobuf/duration.proto.
|
Package durationpb contains generated types for google/protobuf/duration.proto. |
types/known/fieldmaskpb
Package fieldmaskpb contains generated types for google/protobuf/field_mask.proto.
|
Package fieldmaskpb contains generated types for google/protobuf/field_mask.proto. |
types/known/structpb
Package structpb contains generated types for google/protobuf/struct.proto.
|
Package structpb contains generated types for google/protobuf/struct.proto. |
types/known/timestamppb
Package timestamppb contains generated types for google/protobuf/timestamp.proto.
|
Package timestamppb contains generated types for google/protobuf/timestamp.proto. |
internal
|
|
gengogrpc
Package gengogrpc contains the gRPC code generator.
|
Package gengogrpc contains the gRPC code generator. |
Click to show internal directories.
Click to hide internal directories.