descriptors

package
v7.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

package descriptors provides tools for manipulating and inspecting protobuf descriptors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnumDescriptor

EnumDescriptor returns the EnumDescriptorProto describing an enum value, and the FileDescriptorProto in which the enum is defined.

func EnumInFile

EnumInFile uses the given path to find an enum in the given file.

func MessageDescriptor

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

ServiceDescriptor returns the ServiceDescriptorProto describing a service value, and the FileDescriptorProto in which the service is defined.

func ServiceInFile

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

type DescribableEnum interface {
	EnumDescriptor() ([]byte, []int)
}

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

type DescribableMessage interface {
	Descriptor() ([]byte, []int)
}

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

type DescribableService interface {
	ServiceDescriptor() ([]byte, int)
}

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.

Jump to

Keyboard shortcuts

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