Documentation ¶
Index ¶
- Variables
- type ProtoRegistry
- func (s *ProtoRegistry) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error)
- func (s *ProtoRegistry) FindFileByPath(path string) (protoreflect.FileDescriptor, error)
- func (s *ProtoRegistry) HandleMessage(n remoting.ClusterMessage) (remoting.ClusterMessage, error)
- func (s *ProtoRegistry) RegisterFiles(descriptors *descriptorpb.FileDescriptorSet) error
- func (s *ProtoRegistry) SetNotifier(notify func(message remoting.ClusterMessage) error)
- func (s *ProtoRegistry) Start() error
- func (s *ProtoRegistry) Stop() error
- type Resolver
Constants ¶
This section is empty.
Variables ¶
var EmptyRegistry = emptyRegistry{}
EmptyRegistry is a resolver that always returns protoregistry.NotFound for all lookups.
Functions ¶
This section is empty.
Types ¶
type ProtoRegistry ¶
type ProtoRegistry struct {
// contains filtered or unexported fields
}
ProtoRegistry contains all protobuf file descriptors registered with Prana. It first attempts to look up file descriptors registered in the cluster storage. If not found, then tries to look up in the directory backed registry.
func NewProtoRegistry ¶
func NewProtoRegistry(metaController *meta.Controller, clus cluster.Cluster, queryExec common.SimpleQueryExec, loadDir string) *ProtoRegistry
NewProtoRegistry initializes a new file descriptor store. "loadDir" is an optional directory to load file descriptor sets from.
func (*ProtoRegistry) FindDescriptorByName ¶
func (s *ProtoRegistry) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error)
FindDescriptorByName looks up a descriptor by the full name.
This returns (nil, NotFound) if not found.
func (*ProtoRegistry) FindFileByPath ¶
func (s *ProtoRegistry) FindFileByPath(path string) (protoreflect.FileDescriptor, error)
func (*ProtoRegistry) HandleMessage ¶
func (s *ProtoRegistry) HandleMessage(n remoting.ClusterMessage) (remoting.ClusterMessage, error)
func (*ProtoRegistry) RegisterFiles ¶
func (s *ProtoRegistry) RegisterFiles(descriptors *descriptorpb.FileDescriptorSet) error
func (*ProtoRegistry) SetNotifier ¶
func (s *ProtoRegistry) SetNotifier(notify func(message remoting.ClusterMessage) error)
func (*ProtoRegistry) Start ¶
func (s *ProtoRegistry) Start() error
Start the ProtoRegistry, loading descriptors from disk if configured.
type Resolver ¶
func NewDirBackedRegistry ¶
NewDirBackedRegistry recursively walks the directory, looking for protobuf file descriptor sets with the ".bin" extension and loading them into memory. A file descriptor set may contain many descriptors. If a descriptor with the same full name is seen more than once, the last one wins.