protoreflect

module
v0.0.0-...-9afe18d Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: Apache-2.0

README

Protocol Buffer and GRPC Reflection

Build Status

This repo provides reflection APIs for protocol buffers (also known as "protobufs" for short) and GRPC. The core of reflection in protobufs is the descriptor. A descriptor is itself a protobuf message that describes a .proto source file or any element therein. So a collection of descriptors can describe an entire schema of protobuf types, including RPC services.

GoDoc


import "github.com/jhump/protoreflect/desc"

The desc package herein introduces a Descriptor interface and implementations of it that correspond to each of the descriptor types. These new types are effectively smart wrappers around the generated protobuf types that make them much more useful and easier to use.


import "github.com/jhump/protoreflect/desc/protoparse"

The protoparse package allows for parsing of .proto source files into rich descriptors. Without this package, you must invoke protoc to either generate a file descriptor set file or to generate Go code (which has descriptor information embedded in it). This package allows reading the source directly without having to invoke protoc.


import "github.com/jhump/protoreflect/grpcreflect"

The grpcreflect package provides an easy-to-use client for the GRPC reflection service, making it much easier to query for and work with the schemas of remote services.


import "github.com/jhump/protoreflect/dynamic"
import "github.com/jhump/protoreflect/dynamic/grpcdynamic"

The dynamic package provides a dynamic message implementation. It implements proto.Message but is backed by a message descriptor and a map of fields->values, instead of a generated struct. There is also sub-package named grpcdynamic, which provides a dynamic stub implementation. The stub can be used to issue RPC methods using method descriptors instead of generated client interfaces.

Directories

Path Synopsis
Package desc contains "rich descriptors" for protocol buffers.
Package desc contains "rich descriptors" for protocol buffers.
builder
Package builder contains a means of building and modifying proto descriptors programmatically.
Package builder contains a means of building and modifying proto descriptors programmatically.
protoparse
Package protoparse provides functionality for parsing *.proto source files into descriptors that can be used with other protoreflect packages, like dynamic messages and dynamic GRPC clients.
Package protoparse provides functionality for parsing *.proto source files into descriptors that can be used with other protoreflect packages, like dynamic messages and dynamic GRPC clients.
Package dynamic provides an implementation for a dynamic protobuf message.
Package dynamic provides an implementation for a dynamic protobuf message.
grpcdynamic
Package grpcdynamic provides a dynamic RPC stub.
Package grpcdynamic provides a dynamic RPC stub.
msgregistry
Package msgregistry contains a registry of known message and enum types.
Package msgregistry contains a registry of known message and enum types.
Package grpcreflect provides GRPC-specific extensions to protobuf reflection.
Package grpcreflect provides GRPC-specific extensions to protobuf reflection.
Package internal contains some code that should not be exported but needs to be shared across more than one of the protoreflect sub-packages.
Package internal contains some code that should not be exported but needs to be shared across more than one of the protoreflect sub-packages.
testprotos
Package testprotos is a generated protocol buffer package.
Package testprotos is a generated protocol buffer package.
testprotos/nopkg
Package nopkg is a generated protocol buffer package.
Package nopkg is a generated protocol buffer package.
testprotos/pkg
Package pkg is a generated protocol buffer package.
Package pkg is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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