mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-01 11:58:21 +00:00
bfda014ecd
The prototype package provides constructors to create protobuf types that implement the interfaces defined in the protoreflect package. High-level API: func NewFile(t *File) (protoreflect.FileDescriptor, error) type File struct{ ... } type Message struct{ ... } type Field struct{ ... } type Oneof struct{ ... } type Enum struct{ ... } type EnumValue struct{ ... } type Extension struct{ ... } type Service struct{ ... } type Method struct{ ... } func NewEnum(t *StandaloneEnum) (protoreflect.EnumDescriptor, error) func NewMessage(t *StandaloneMessage) (protoreflect.MessageDescriptor, error) func NewExtension(t *StandaloneExtension) (protoreflect.ExtensionDescriptor, error) type StandaloneEnum struct{ ... } type StandaloneMessage struct{ ... } type StandaloneExtension struct{ ... } func PlaceholderFile(path string, pkg protoreflect.FullName) protoreflect.FileDescriptor func PlaceholderEnum(name protoreflect.FullName) protoreflect.EnumDescriptor func PlaceholderMessage(name protoreflect.FullName) protoreflect.MessageDescriptor This CL is missing some features that are to be added later: * The stringer methods are not implemented, providing no way to print the descriptors in a humanly readable manner. * There is no support for proto options or retrieving the raw descriptor. * There are constructors for Go specific types (e.g., protoreflect.MessageType). We drop go1.9 support since we use strings.Builder. We switch to go.11rc1 to obtain some bug fixes for modules. Change-Id: Ieac9a2530afc81e5a5bb9ab5816804372f652b18 Reviewed-on: https://go-review.googlesource.com/129057 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Herbie Ong <herbie@google.com> |
||
---|---|---|
.. | ||
descriptor.go | ||
placeholder_type.go | ||
placeholder.go | ||
protofile_list_gen.go | ||
protofile_list.go | ||
protofile_type.go | ||
protofile.go | ||
standalone_type.go | ||
standalone.go | ||
stringer.go | ||
type_test.go | ||
validate.go |