protobuf

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DescriptorProvider

type DescriptorProvider interface {
	// FindSymbol returns a descriptor for the given fully-qualified symbol name.
	FindSymbol(fullyQualifiedName string) (desc.Descriptor, error)

	Close()
}

DescriptorProvider is a source of protobuf descriptor information. It can be backed by a FileDescriptorSet proto (like a file generated by protoc). Adapted from https://github.com/fullstorydev/grpcurl

func NewDescriptorProviderFileDescriptorSet

func NewDescriptorProviderFileDescriptorSet(files *descriptor.FileDescriptorSet) (DescriptorProvider, error)

NewDescriptorProviderFileDescriptorSet creates a DescriptorSource that is backed by the FileDescriptorSet.

func NewDescriptorProviderFileDescriptorSetBins

func NewDescriptorProviderFileDescriptorSetBins(fileNames ...string) (DescriptorProvider, error)

NewDescriptorProviderFileDescriptorSetBins creates a DescriptorSource that is backed by the named files, whose contents are encoded FileDescriptorSet protos.

func NewDescriptorProviderReflection

func NewDescriptorProviderReflection(args ReflectionArgs) (DescriptorProvider, error)

NewDescriptorProviderReflection returns a DescriptorProvider that reaches out to a reflection server to access file descriptors.

type ReflectionArgs

type ReflectionArgs struct {
	Caller  string
	Service string
	Peers   []string
	Timeout time.Duration
}

ReflectionArgs are args for constructing a DescriptorProvider that reaches out to a reflection server.

Jump to

Keyboard shortcuts

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