Documentation ¶
Overview ¶
package descriptors provides tools for manipulating and inspecting protobuf descriptors.
Index ¶
- func EnumDescriptor(enum DescribableEnum) (*protobuf.FileDescriptorProto, *protobuf.EnumDescriptorProto, error)
- func EnumInFile(fd *protobuf.FileDescriptorProto, path []int) (*protobuf.EnumDescriptorProto, error)
- func MessageDescriptor(msg DescribableMessage) (*protobuf.FileDescriptorProto, *protobuf.DescriptorProto, error)
- func MessageInFile(fd *protobuf.FileDescriptorProto, path []int) (*protobuf.DescriptorProto, error)
- func ServiceDescriptor(svc DescribableService) (*protobuf.FileDescriptorProto, *protobuf.ServiceDescriptorProto, error)
- func ServiceInFile(fd *protobuf.FileDescriptorProto, index int) (*protobuf.ServiceDescriptorProto, error)
- func UnpackFile(gz []byte) (*protobuf.FileDescriptorProto, error)
- type DescribableEnum
- type DescribableMessage
- type DescribableService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnumDescriptor ¶
func EnumDescriptor(enum DescribableEnum) (*protobuf.FileDescriptorProto, *protobuf.EnumDescriptorProto, error)
EnumDescriptor returns the EnumDescriptorProto describing an enum value, and the FileDescriptorProto in which the enum is defined.
func EnumInFile ¶
func EnumInFile(fd *protobuf.FileDescriptorProto, path []int) (*protobuf.EnumDescriptorProto, error)
EnumInFile uses the given path to find an enum in the given file.
func MessageDescriptor ¶
func MessageDescriptor(msg DescribableMessage) (*protobuf.FileDescriptorProto, *protobuf.DescriptorProto, error)
MessageDescriptor returns the DescriptorProto describing a message value, and the FileDescriptorProto in which the message is defined.
func MessageInFile ¶
func MessageInFile(fd *protobuf.FileDescriptorProto, path []int) (*protobuf.DescriptorProto, error)
MessageInFile finds a message in fd using the given path as an address.
func ServiceDescriptor ¶
func ServiceDescriptor(svc DescribableService) (*protobuf.FileDescriptorProto, *protobuf.ServiceDescriptorProto, error)
ServiceDescriptor returns the ServiceDescriptorProto describing a service value, and the FileDescriptorProto in which the service is defined.
func ServiceInFile ¶
func ServiceInFile(fd *protobuf.FileDescriptorProto, index int) (*protobuf.ServiceDescriptorProto, error)
ServiceInFile uses the given index to find the service within the given FileDescriptorProto.
func UnpackFile ¶
func UnpackFile(gz []byte) (*protobuf.FileDescriptorProto, error)
UnpackFile reads gz as a gzipped, protobuf-encoded FileDescriptorProto. This is the format used to store descriptors in protoc-gen-go and protoc-gen-twirp.
Types ¶
type DescribableEnum ¶
A DescribableEnum provides a gzipped, protobuf-encoded FileDescriptorProto, and a series of ints which index into the File to provide the address of an EnumDescriptorProto describing an enum.
This interface should be fulfilled by any enums generated by protoc-gen-go.
type DescribableMessage ¶
A DescribableMessage provides a gzipped, protobuf-encoded FileDescriptorProto, and a series of ints which index into the File to provide the address of a DescriptorProto describing a message.
This interface should be fulfilled by any message structs generated by protoc-gen-go.
type DescribableService ¶
A DescribableService provides a gzipped, protobuf-encoded FileDescriptorProto, and an int which indexes into the File to provide the address of a ServiceDescriptorProto describing a service.
This interface should be fulfilled by any servers generated by protoc-gen-twirp.