protoc

package
v1.0.0-beta.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0, BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package protoc is used to generate protoc-gen-go files

Index

Constants

This section is empty.

Variables

View Source
var GenerateVersionMarkers = true

GenerateVersionMarkers specifies whether to generate version markers.

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

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

type Format

type Format int
const (

	// Descriptor uses the serialization format that protoc uses with the
	// google.protobuf.FieldDescriptorProto.default_value field.
	Descriptor Format

	// GoTag uses the historical serialization format in Go struct field tags.
	GoTag
)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL