internal

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package internal contains code that is shared by both reflection package and the test package. The packages are split in this way inorder to avoid depenedency to deprecated package github.com/golang/protobuf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func V1AlphaToV1Request

V1AlphaToV1Request converts a v1alpha ServerReflectionRequest to a v1.

func V1AlphaToV1Response

V1AlphaToV1Response converts a v1alpha ServerReflectionResponse to a v1.

func V1ToV1AlphaRequest

V1ToV1AlphaRequest converts a v1 ServerReflectionRequest to a v1alpha.

func V1ToV1AlphaResponse

V1ToV1AlphaResponse converts a v1 ServerReflectionResponse to a v1alpha.

Types

type ExtensionResolver

type ExtensionResolver interface {
	protoregistry.ExtensionTypeResolver
	RangeExtensionsByMessage(message protoreflect.FullName, f func(protoreflect.ExtensionType) bool)
}

ExtensionResolver is the interface used to query details about extensions. This interface is satisfied by protoregistry.GlobalTypes.

type ServerReflectionServer

type ServerReflectionServer struct {
	v1alphareflectiongrpc.UnimplementedServerReflectionServer
	S            ServiceInfoProvider
	DescResolver protodesc.Resolver
	ExtResolver  ExtensionResolver
}

ServerReflectionServer is the server API for ServerReflection service.

func (*ServerReflectionServer) AllExtensionNumbersForTypeName

func (s *ServerReflectionServer) AllExtensionNumbersForTypeName(name string) ([]int32, error)

AllExtensionNumbersForTypeName returns all extension numbers for the given type.

func (*ServerReflectionServer) FileDescEncodingContainingExtension

func (s *ServerReflectionServer) FileDescEncodingContainingExtension(typeName string, extNum int32, sentFileDescriptors map[string]bool) ([][]byte, error)

FileDescEncodingContainingExtension finds the file descriptor containing given extension, finds all of its previously unsent transitive dependencies, does marshalling on them, and returns the marshalled result.

func (*ServerReflectionServer) FileDescEncodingContainingSymbol

func (s *ServerReflectionServer) FileDescEncodingContainingSymbol(name string, sentFileDescriptors map[string]bool) ([][]byte, error)

FileDescEncodingContainingSymbol finds the file descriptor containing the given symbol, finds all of its previously unsent transitive dependencies, does marshalling on them, and returns the marshalled result. The given symbol can be a type, a service or a method.

func (*ServerReflectionServer) FileDescWithDependencies

func (s *ServerReflectionServer) FileDescWithDependencies(fd protoreflect.FileDescriptor, sentFileDescriptors map[string]bool) ([][]byte, error)

FileDescWithDependencies returns a slice of serialized fileDescriptors in wire format ([]byte). The fileDescriptors will include fd and all the transitive dependencies of fd with names not in sentFileDescriptors.

func (*ServerReflectionServer) ListServices

ListServices returns the names of services this server exposes.

func (*ServerReflectionServer) ServerReflectionInfo

ServerReflectionInfo is the reflection service handler.

type ServiceInfoProvider

type ServiceInfoProvider interface {
	GetServiceInfo() map[string]grpc.ServiceInfo
}

ServiceInfoProvider is an interface used to retrieve metadata about the services to expose.

Jump to

Keyboard shortcuts

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