protodesc

package
v2.0.0-...-d24bc72 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2019 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package protodesc provides for converting descriptorpb.FileDescriptorProto to/from the reflective protoreflect.FileDescriptor.

Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFile

NewFile creates a new protoreflect.FileDescriptor from the provided file descriptor message. The file must represent a valid proto file according to protobuf semantics.

Any import 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.

The caller must relinquish full ownership of the input fd and must not access or mutate any fields.

func ToDescriptorProto

func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto

ToDescriptorProto converts a MessageDescriptor to a google.protobuf.DescriptorProto.

func ToEnumDescriptorProto

func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumDescriptorProto

ToEnumDescriptorProto converts a EnumDescriptor to a google.protobuf.EnumDescriptorProto.

func ToEnumValueDescriptorProto

func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto

ToEnumValueDescriptorProto converts a EnumValueDescriptor to a google.protobuf.EnumValueDescriptorProto.

func ToFieldDescriptorProto

func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto

ToFieldDescriptorProto converts a FieldDescriptor to a google.protobuf.FieldDescriptorProto.

func ToFileDescriptorProto

func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto

ToFileDescriptorProto converts a FileDescriptor to a google.protobuf.FileDescriptorProto.

func ToMethodDescriptorProto

func ToMethodDescriptorProto(method protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto

ToMethodDescriptorProto converts a MethodDescriptor to a google.protobuf.MethodDescriptorProto.

func ToOneofDescriptorProto

func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.OneofDescriptorProto

ToOneofDescriptorProto converts a OneofDescriptor to a google.protobuf.OneofDescriptorProto.

func ToServiceDescriptorProto

func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descriptorpb.ServiceDescriptorProto

ToServiceDescriptorProto converts a ServiceDescriptor to a google.protobuf.ServiceDescriptorProto.

Types

This section is empty.

Jump to

Keyboard shortcuts

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