protoregistry

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyRegistered = fmt.Errorf("proto schema already registered")

ErrAlreadyRegistered is returned when a descriptor is already registered.

View Source
var ErrNotFound = fmt.Errorf("not found")

ErrNotFound is returned when a descriptor is not found.

Functions

func GetDescriptor

func GetDescriptor(protoFqn string) (protoreflect.MessageDescriptor, error)

GetDescriptor returns a Protocol Buffer Descriptor given a fully qualified name (pacakge.MessageName).

func Register

func Register(schema string) (string, error)

Register takes a Protobuf Schema or a URL of a Protobuf Schema and registers it in the global registry. It returns the package name of the schema and an error if occurred.

func SchemaToFDs

func SchemaToFDs(schema string) ([]*desc.FileDescriptor, string, error)

SchemaToFDs takes a Protobuf Schema or a URL of a Protobuf Schema and returns a list of FileDescriptors, the package name of the schama, the package name of the schema and an error if occurred.

Types

This section is empty.

Jump to

Keyboard shortcuts

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