Documentation ¶
Overview ¶
Package protoc is used to generate protoc-gen-go files
Index ¶
- Variables
- func DefValMarshal(v pref.Value, ev pref.EnumValueDescriptor, k pref.Kind, f Format) (string, error)
- func GenerateFile(gen *protogen.Plugin, file *protogen.File, g *generator.GeneratedFile) *generator.GeneratedFile
- func TagMarshal(fd pref.FieldDescriptor, enumName string) string
- type Format
Constants ¶
This section is empty.
Variables ¶
var GenerateVersionMarkers = true
GenerateVersionMarkers specifies whether to generate version markers.
var SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
SupportedFeatures reports the set of supported protobuf language features.
Functions ¶
func DefValMarshal ¶
func DefValMarshal(v pref.Value, ev pref.EnumValueDescriptor, k pref.Kind, f Format) (string, error)
DefValMarshal serializes v as the default string according to the given kind k. When specifying the Descriptor format for an enum kind, the associated enum value descriptor must be provided.
func GenerateFile ¶
func GenerateFile(gen *protogen.Plugin, file *protogen.File, g *generator.GeneratedFile) *generator.GeneratedFile
GenerateFile generates the contents of a .pb.go file.
func TagMarshal ¶
func TagMarshal(fd pref.FieldDescriptor, enumName string) string
TagMarshal encodes the protoreflect.FieldDescriptor as a tag.
The enumName must be provided if the kind is an enum. Historically, the formulation of the enum "name" was the proto package dot-concatenated with the generated Go identifier for the enum type. Depending on the context on how Marshal is called, there are different ways through which that information is determined. As such it is the caller's responsibility to provide a function to obtain that information.
Types ¶
Directories ¶
Path | Synopsis |
---|---|
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. |
Package version records versioning information about this module.
|
Package version records versioning information about this module. |