Documentation ¶
Index ¶
- func BuildFileDescriptorSet(descriptors []*descriptorpb.FileDescriptorProto) (*protoregistry.Files, error)
- func FetchAllDescriptors(ctx context.Context, grpcClient *grpc.ClientConn, maxRetries uint) ([]*descriptorpb.FileDescriptorProto, error)
- type CustomResolver
- func (r *CustomResolver) FindExtensionByName(_ protoreflect.FullName) (protoreflect.ExtensionType, error)
- func (r *CustomResolver) FindExtensionByNumber(_ protoreflect.FullName, _ protoreflect.FieldNumber) (protoreflect.ExtensionType, error)
- func (r *CustomResolver) FindMessageByName(name protoreflect.FullName) (protoreflect.MessageType, error)
- func (r *CustomResolver) FindMessageByURL(url string) (protoreflect.MessageType, error)
- func (r *CustomResolver) FindMethodDescriptor(serviceName, methodName string) (protoreflect.MethodDescriptor, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFileDescriptorSet ¶
func BuildFileDescriptorSet(descriptors []*descriptorpb.FileDescriptorProto) (*protoregistry.Files, error)
BuildFileDescriptorSet builds the file descriptor set from the descriptors.
func FetchAllDescriptors ¶
func FetchAllDescriptors(ctx context.Context, grpcClient *grpc.ClientConn, maxRetries uint) ([]*descriptorpb.FileDescriptorProto, error)
FetchAllDescriptors retrieves all file descriptors supported by the server.
Types ¶
type CustomResolver ¶
type CustomResolver struct {
// contains filtered or unexported fields
}
CustomResolver implements the Resolver interface required by protojson. It fetches file descriptors from a gRPC server using the reflection API and registers them in a protoregistry.Files. It also correctly resolves message types by fetching dependencies recursively.
func NewCustomResolver ¶
func NewCustomResolver(files *protoregistry.Files, grpcConn *grpc.ClientConn, ctx context.Context, maxRetries uint) *CustomResolver
NewCustomResolver creates a new instance of CustomResolver.
func (*CustomResolver) FindExtensionByName ¶
func (r *CustomResolver) FindExtensionByName(_ protoreflect.FullName) (protoreflect.ExtensionType, error)
FindExtensionByName is not implemented.
func (*CustomResolver) FindExtensionByNumber ¶
func (r *CustomResolver) FindExtensionByNumber(_ protoreflect.FullName, _ protoreflect.FieldNumber) (protoreflect.ExtensionType, error)
FindExtensionByNumber is not implemented.
func (*CustomResolver) FindMessageByName ¶
func (r *CustomResolver) FindMessageByName(name protoreflect.FullName) (protoreflect.MessageType, error)
FindMessageByName finds a message descriptor by its name.
func (*CustomResolver) FindMessageByURL ¶
func (r *CustomResolver) FindMessageByURL(url string) (protoreflect.MessageType, error)
FindMessageByURL finds a message descriptor by its URL.
func (*CustomResolver) FindMethodDescriptor ¶
func (r *CustomResolver) FindMethodDescriptor(serviceName, methodName string) (protoreflect.MethodDescriptor, error)