Documentation ¶
Overview ¶
Package internal contains some code that should not be exported but needs to be shared across more than one of the protoreflect sub-packages.
Index ¶
- Variables
- func DecodeFileDescriptor(element string, fdb []byte) (*descriptorpb.FileDescriptorProto, error)
- func GetUnrecognized(msg proto.Message) []byte
- func LoadFileDescriptor(file string) (*descriptorpb.FileDescriptorProto, error)
- func SetUnrecognized(msg proto.Message, data []byte)
- type ErrNoSuchFile
Constants ¶
This section is empty.
Variables ¶
var StdFileAliases = map[string]string{
"google/protobuf/any.proto": "github.com/golang/protobuf/ptypes/any/any.proto",
"google/protobuf/duration.proto": "github.com/golang/protobuf/ptypes/duration/duration.proto",
"google/protobuf/empty.proto": "github.com/golang/protobuf/ptypes/empty/empty.proto",
"google/protobuf/struct.proto": "github.com/golang/protobuf/ptypes/struct/struct.proto",
"google/protobuf/timestamp.proto": "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto",
"google/protobuf/wrappers.proto": "github.com/golang/protobuf/ptypes/wrappers/wrappers.proto",
"google/protobuf/api.proto": "src/google/protobuf/api.proto",
"google/protobuf/field_mask.proto": "src/google/protobuf/field_mask.proto",
"google/protobuf/source_context.proto": "src/google/protobuf/source_context.proto",
"google/protobuf/type.proto": "src/google/protobuf/type.proto",
}
StdFileAliases are the standard protos included with protoc, but older versions of their respective packages registered them using incorrect paths.
Functions ¶
func DecodeFileDescriptor ¶
func DecodeFileDescriptor(element string, fdb []byte) (*descriptorpb.FileDescriptorProto, error)
DecodeFileDescriptor decodes the bytes of a registered file descriptor. Registered file descriptors are first "proto encoded" (e.g. binary format for the descriptor protos) and then gzipped. So this function gunzips and then unmarshals into a descriptor proto.
func GetUnrecognized ¶
GetUnrecognized fetches the bytes of unrecognized fields for the given message.
func LoadFileDescriptor ¶
func LoadFileDescriptor(file string) (*descriptorpb.FileDescriptorProto, error)
LoadFileDescriptor loads a registered descriptor and decodes it. If the given name cannot be loaded but is a known standard name, an alias will be tried, so the standard files can be loaded even if linked against older "known bad" versions of packages.
func SetUnrecognized ¶
SetUnrecognized adds the given bytes to the unrecognized fields for the given message.
Types ¶
type ErrNoSuchFile ¶
type ErrNoSuchFile string
func (ErrNoSuchFile) Error ¶
func (e ErrNoSuchFile) Error() string