package protodesc

Import Path
	google.golang.org/protobuf/reflect/protodesc (on go.dev)

Dependency Relation
	imports 20 packages, and imported by one package

Involved Source Files Package protodesc provides functionality for converting FileDescriptorProto messages to/from [protoreflect.FileDescriptor] values. The google.protobuf.FileDescriptorProto is a protobuf message that describes the type information for a .proto file in a form that is easily serializable. The [protoreflect.FileDescriptor] is a more structured representation of the FileDescriptorProto message where references and remote dependencies can be directly followed. desc_init.go desc_resolve.go desc_validate.go editions.go proto.go
Package-Level Type Names (total 2)
/* sort by: | */
FileOptions configures the construction of file descriptors. AllowUnresolvable configures New to permissively allow unresolvable file, enum, or message dependencies. Unresolved dependencies are replaced by placeholder equivalents. The following dependencies may be left unresolved: • Resolving an imported file. • Resolving the type for a message field or extension field. If the kind of the field is unknown, then a placeholder is used for both the Enum and Message accessors on the protoreflect.FieldDescriptor. • Resolving an enum value set as the default for an optional enum field. If unresolvable, the protoreflect.FieldDescriptor.Default is set to the first value in the associated enum (or zero if the also enum dependency is also unresolvable). The protoreflect.FieldDescriptor.DefaultEnumValue is populated with a placeholder. • Resolving the extended message type for an extension field. • Resolving the input or output message type for a service method. If the unresolved dependency uses a relative name, then the placeholder will contain an invalid FullName with a "*." prefix, indicating that the starting prefix of the full name is unknown. NoUnkeyedLiterals pragma.NoUnkeyedLiterals New creates a new [protoreflect.FileDescriptor] from the provided file descriptor message. The file must represent a valid proto file according to protobuf semantics. The returned descriptor is a deep copy of the input. Any imported files, enum types, or message types referenced in the file are resolved using the provided registry. When looking up an import file path, the path must be unique. The newly created file descriptor is not registered back into the provided file registry. NewFiles creates a new [protoregistry.Files] from the provided FileDescriptorSet message. The descriptor set must include only valid files according to protobuf semantics. The returned descriptors are a deep copy of the input.
Resolver is the resolver used by [NewFile] to resolve dependencies. The enums and messages provided must belong to some parent file, which is also registered. It is implemented by [protoregistry.Files]. ( Resolver) FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) ( Resolver) FindFileByPath(string) (protoreflect.FileDescriptor, error) *google.golang.org/protobuf/reflect/protoregistry.Files func NewFile(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) func FileOptions.New(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error)
Package-Level Functions (total 10)
NewFile creates a new [protoreflect.FileDescriptor] from the provided file descriptor message. See [FileOptions.New] for more information.
NewFiles creates a new [protoregistry.Files] from the provided FileDescriptorSet message. See [FileOptions.NewFiles] for more information.
ToDescriptorProto copies a [protoreflect.MessageDescriptor] into a google.protobuf.DescriptorProto message.
ToEnumDescriptorProto copies a [protoreflect.EnumDescriptor] into a google.protobuf.EnumDescriptorProto message.
ToEnumValueDescriptorProto copies a [protoreflect.EnumValueDescriptor] into a google.protobuf.EnumValueDescriptorProto message.
ToFieldDescriptorProto copies a [protoreflect.FieldDescriptor] into a google.protobuf.FieldDescriptorProto message.
ToFileDescriptorProto copies a [protoreflect.FileDescriptor] into a google.protobuf.FileDescriptorProto message.
ToMethodDescriptorProto copies a [protoreflect.MethodDescriptor] into a google.protobuf.MethodDescriptorProto message.
ToOneofDescriptorProto copies a [protoreflect.OneofDescriptor] into a google.protobuf.OneofDescriptorProto message.
ToServiceDescriptorProto copies a [protoreflect.ServiceDescriptor] into a google.protobuf.ServiceDescriptorProto message.