Skip to content

Reflection (Rich Descriptors) for Go Protocol Buffers

License

Notifications You must be signed in to change notification settings

notbdu/protoreflect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Go doc: https://godoc.org/github.com/jhump/protoreflect


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/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.

About

Reflection (Rich Descriptors) for Go Protocol Buffers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.0%
  • Protocol Buffer 2.8%
  • Shell 0.2%