twirp: github.com/twitchtv/twirp/internal/descriptors Index | Files

package descriptors

import "github.com/twitchtv/twirp/internal/descriptors"

package descriptors provides tools for manipulating and inspecting protobuf descriptors.

Index

Package Files

descriptors.go

func EnumDescriptor Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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.

type DescribableEnum Uses

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 Uses

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 Uses

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.

Package descriptors imports 6 packages (graph). Updated 2018-01-21. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).