registry

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 37 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddServicesFromBSR

func AddServicesFromBSR(registry LoaderTarget, module string) error

AddServicesFromBSR adds services from the BSR. Not yet supported

func AddServicesFromDescriptorsFileJSON

func AddServicesFromDescriptorsFileJSON(registry LoaderTarget, filepath string) error

AddServicesFromDescriptorsFileJSON imports services from a .json file

func AddServicesFromDescriptorsFilePB

func AddServicesFromDescriptorsFilePB(registry LoaderTarget, filepath string) error

AddServicesFromDescriptorsFilePB imports services from a .pb file

func AddServicesFromDescriptorsFileTXTPB

func AddServicesFromDescriptorsFileTXTPB(registry LoaderTarget, filepath string) error

AddServicesFromDescriptorsFileTXTPB imports services from a .txtpb file

func AddServicesFromDescriptorsFileYAML

func AddServicesFromDescriptorsFileYAML(registry LoaderTarget, filepath string) error

AddServicesFromDescriptorsFileYAML imports services from a .yaml file

func AddServicesFromGlobal added in v0.0.20

func AddServicesFromGlobal(registry LoaderTarget) error

AddServicesFromGlobal adds the 'well known' types to the registry. This is typically implicitly called.

func AddServicesFromPath

func AddServicesFromPath(registry LoaderTarget, path string) error

AddServicesFromPath imports services from a given 'path' which can be a local file path, directory, BSR repo, server address for server reflection.

func AddServicesFromProtoFile

func AddServicesFromProtoFile(registry LoaderTarget, filepath string) error

AddServicesFromDescriptorsFilePB imports services from a .proto file

func AddServicesFromReflection

func AddServicesFromReflection(registry LoaderTarget, addr string) error

AddServicesFromReflection uses the given address to connect to a gRPC server that has Server Reflection. The services are imported from the file descriptors advertised there.

func AddServicesFromSingleFile

func AddServicesFromSingleFile(registry LoaderTarget, filepath string) error

AddServicesFromSingleFile imports services from a single (non-directory) file

func NewHandler added in v0.0.19

func NewHandler(registry ServiceRegistry) *handler

func NewMessage added in v0.3.0

func NewServiceRegistry

func NewServiceRegistry() (*serviceRegistry, error)

Types

type LoaderTarget added in v0.3.2

type LoaderTarget interface {
	protodesc.Resolver
	RegisterFile(file protoreflect.FileDescriptor) error
}

type ServiceRegistry

type ServiceRegistry interface {
	Get(name string) protoreflect.ServiceDescriptor
	Reset() error
	ForEachService(cb func(protoreflect.ServiceDescriptor) bool)
	ServiceCount() int
	Files() *protoregistry.Files
	NumFiles() int
	// Act like protoreflect.Files
	RegisterFile(file protoreflect.FileDescriptor) error
	// protoregistry.Resolver
	FindFileByPath(string) (protoreflect.FileDescriptor, error)
	FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error)
}

Jump to

Keyboard shortcuts

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