protolib

package
v0.1.5-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 (*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.

func (*ProtoRegistry) Stop

func (s *ProtoRegistry) Stop() error

Stop the ProtoRegistry

type Resolver

type Resolver protodesc.Resolver

func NewDirBackedRegistry

func NewDirBackedRegistry(dir string) (Resolver, error)

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.

Jump to

Keyboard shortcuts

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