registry

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package registry provides a type on top of protoregistry.Files that can be used as a protoregistry.ExtensionTypeResolver and a protoregistry.MessageTypeResolver. This allows a protoregistry.Files to be used as Resolver for protobuf encoding marshaling options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDynamicTypes added in v0.0.16

func AddDynamicTypes(t *protoregistry.Types, fds *descriptorpb.FileDescriptorSet) error

AddDynamicTypes adds dynamicpb types to the given Types registry for all Messages, Enums and Extensions in the given FileDescriptorSet. If a type already exists in the Types registry, the dynamic type will not be added to replace it, and instead will be ignored.

func CloneTypes added in v0.0.16

func CloneTypes(in *protoregistry.Types) *protoregistry.Types

CloneTypes returns a clone of the given protoregistry.Types registry. It may panic if any of the messages, enums or extensions in the given registry cannot be added to the clone, however that should never happen.

Types

type Files

type Files struct {
	protoregistry.Files
}

func NewFiles

func NewFiles(fds *descriptorpb.FileDescriptorSet) (*Files, error)

func (*Files) FindExtensionByName

func (f *Files) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error)

func (*Files) FindExtensionByNumber

func (f *Files) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error)

func (*Files) FindMessageByName

func (f *Files) FindMessageByName(name protoreflect.FullName) (protoreflect.MessageType, error)

func (*Files) FindMessageByURL

func (f *Files) FindMessageByURL(url string) (protoreflect.MessageType, error)

func (*Files) GetExtensionsOfMessage

func (f *Files) GetExtensionsOfMessage(message protoreflect.FullName) []protoreflect.ExtensionType

Jump to

Keyboard shortcuts

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