1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 06:45:31 +01:00

Merge pull request #27395 from nalind/grpc-noop

Parse grpc requests on the service socket
This commit is contained in:
openshift-merge-bot[bot]
2025-11-10 13:45:27 +00:00
committed by GitHub
26 changed files with 3333 additions and 51 deletions

View File

@@ -238,11 +238,11 @@ all: binaries docs
.PHONY: binaries
ifeq ($(GOOS),freebsd)
binaries: podman podman-remote ## (FreeBSD) Build podman and podman-remote binaries
binaries: podman podman-remote podman-testing ## (FreeBSD) Build podman, podman-remote, and podman-testing binaries
else ifneq (, $(findstring $(GOOS),darwin windows))
binaries: podman-remote ## (macOS/Windows) Build podman-remote (client) only binaries
else
binaries: podman podman-remote podman-testing podmansh rootlessport quadlet ## (Linux) Build podman, podman-remote and rootlessport binaries quadlet
binaries: podman podman-remote podman-testing podmansh rootlessport quadlet ## (Linux) Build podman, podman-remote, podmansh, rootlessport, and quadlet binaries
endif
# Extract text following double-# for targets, as their description for
@@ -477,7 +477,7 @@ $(SRCBINDIR)/podman-testing: $(SOURCES) go.mod go.sum
-o $@ ./cmd/podman-testing
.PHONY: podman-testing
podman-testing: bin/podman-testing
podman-testing: $(SRCBINDIR)/podman-testing
###
### Secondary binary-build targets

152
cmd/podman-testing/call.go Normal file
View File

@@ -0,0 +1,152 @@
package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net"
"strings"
"github.com/containers/podman/v6/pkg/api/grpcpb"
"github.com/containers/podman/v6/pkg/bindings"
"github.com/containers/podman/v6/pkg/domain/entities"
"github.com/spf13/cobra"
"go.podman.io/common/pkg/completion"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
reflectionv1 "google.golang.org/grpc/reflection/grpc_reflection_v1"
)
var (
noopDescription = `Call the no-op GRPC endpoint.`
noopCmd = &cobra.Command{
Use: "noop [arg]",
Args: cobra.MaximumNArgs(1),
Short: "Call the no-op GRPC endpoint",
Long: noopDescription,
RunE: noop,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman-testing noop`,
}
lsDescription = `List GRPC endpoints.`
lsCmd = &cobra.Command{
Use: "ls [arg]",
Args: cobra.MaximumNArgs(1),
Short: "Call an RPC endpoint",
Long: lsDescription,
RunE: ls,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman-testing ls`,
}
)
func init() {
mainCmd.AddCommand(noopCmd)
mainCmd.AddCommand(lsCmd)
}
func ls(_ *cobra.Command, args []string) error {
if podmanConfig.EngineMode != entities.TunnelMode {
return errors.New("only available in remote mode")
}
ctx, grpcClient, err := getGrpcClient()
if err != nil {
return fmt.Errorf("setting up grpc client for podman service: %w", err)
}
if err != nil {
return fmt.Errorf("setting up grpc client for podman service: %w", err)
}
reflectionClient := reflectionv1.NewServerReflectionClient(grpcClient)
if reflectionClient == nil {
return fmt.Errorf("setting up client for reflection grpc service: %w", err)
}
info, err := reflectionClient.ServerReflectionInfo(ctx)
if err != nil {
return fmt.Errorf("reflection grpc service: %w", err)
}
ls := ""
if len(args) > 1 {
ls = args[1]
}
err = info.Send(&reflectionv1.ServerReflectionRequest{
MessageRequest: &reflectionv1.ServerReflectionRequest_ListServices{
ListServices: ls,
},
})
if err != nil {
return fmt.Errorf("reflection grpc service: %w", err)
}
err = info.CloseSend()
if err != nil {
return fmt.Errorf("reflection grpc service: %w", err)
}
var response reflectionv1.ServerReflectionResponse
err = info.RecvMsg(&response)
for err == nil {
var out []byte
out, err = json.Marshal(response.GetListServicesResponse())
if err != nil {
return fmt.Errorf("encoding response from grpc service: %w", err)
}
fmt.Println(string(out))
response.Reset()
err = info.RecvMsg(&response)
}
if !errors.Is(err, io.EOF) {
return fmt.Errorf("unexpected grpc protocol error: %w", err)
}
return nil
}
func noop(_ *cobra.Command, args []string) error {
var out []byte
switch podmanConfig.EngineMode {
case entities.TunnelMode:
ctx, grpcClient, err := getGrpcClient()
if err != nil {
return fmt.Errorf("setting up grpc client for podman service: %w", err)
}
noopClient := grpcpb.NewNoopClient(grpcClient)
if noopClient == nil {
return fmt.Errorf("setting up client for noop grpc service: %w", err)
}
var request grpcpb.NoopRequest
if encoded := strings.Join(args, ""); len(encoded) > 0 {
if err := json.Unmarshal([]byte(encoded), &request); err != nil {
return fmt.Errorf("parsing client request contents for noop grpc service: %w", err)
}
}
response, err := noopClient.Noop(ctx, &request)
if err != nil {
return fmt.Errorf("noop grpc service: %w", err)
}
out, err = json.Marshal(response)
if err != nil {
return fmt.Errorf("encoding response from grpc service: %w", err)
}
default:
return errors.New("only available in remote mode")
}
fmt.Println(string(out))
return nil
}
func getGrpcClient() (context.Context, *grpc.ClientConn, error) {
ctx, err := bindings.NewConnection(mainContext, podmanConfig.URI)
if err != nil {
return nil, nil, fmt.Errorf("connecting to podman service: %w", err)
}
client, err := bindings.GetClient(ctx)
if err != nil {
return nil, nil, fmt.Errorf("obtaining client handle for podman service: %w", err)
}
onlyPodmanSystemServiceDialer := grpc.WithContextDialer(func(ctx context.Context, _ string) (net.Conn, error) { return client.GetDialer(ctx) })
withoutEncryption := grpc.WithTransportCredentials(insecure.NewCredentials())
grpcClient, err := grpc.NewClient(podmanConfig.URI, onlyPodmanSystemServiceDialer, withoutEncryption)
if err != nil {
return nil, nil, fmt.Errorf("setting up grpc client for podman service: %w", err)
}
return ctx, grpcClient, err
}

View File

@@ -1,4 +1,4 @@
//go:build !remote
//go:build (linux || freebsd) && !remote
package main
@@ -20,7 +20,7 @@ var (
Long: createStorageLayerDescription,
RunE: createStorageLayer,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing create-storage-layer`,
Example: `podman-testing create-storage-layer`,
}
createStorageLayerOpts entities.CreateStorageLayerOptions
@@ -33,7 +33,7 @@ var (
Long: createLayerDescription,
RunE: createLayer,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing create-layer`,
Example: `podman-testing create-layer`,
}
createLayerOpts entities.CreateLayerOptions
@@ -46,7 +46,7 @@ var (
Long: createImageDescription,
RunE: createImage,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing create-image`,
Example: `podman-testing create-image`,
}
createImageOpts entities.CreateImageOptions
@@ -59,7 +59,7 @@ var (
Long: createContainerDescription,
RunE: createContainer,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing create-container`,
Example: `podman-testing create-container`,
}
createContainerOpts entities.CreateContainerOptions

View File

@@ -1,4 +1,4 @@
//go:build !remote
//go:build (linux || freebsd) && !remote
package main
@@ -21,7 +21,7 @@ var (
Long: createLayerDataDescription,
RunE: createLayerData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing create-layer-data`,
Example: `podman-testing create-layer-data`,
}
createLayerDataOpts entities.CreateLayerDataOptions
@@ -37,7 +37,7 @@ var (
Long: createImageDataDescription,
RunE: createImageData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing create-image-data`,
Example: `podman-testing create-image-data`,
}
createImageDataOpts entities.CreateImageDataOptions
@@ -53,7 +53,7 @@ var (
Long: createContainerDataDescription,
RunE: createContainerData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing create-container-data`,
Example: `podman-testing create-container-data`,
}
createContainerDataOpts entities.CreateContainerDataOptions
@@ -69,7 +69,7 @@ var (
Long: modifyLayerDataDescription,
RunE: modifyLayerData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing modify-layer-data`,
Example: `podman-testing modify-layer-data`,
}
modifyLayerDataOpts entities.ModifyLayerDataOptions
@@ -84,7 +84,7 @@ var (
Long: modifyImageDataDescription,
RunE: modifyImageData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing modify-image-data`,
Example: `podman-testing modify-image-data`,
}
modifyImageDataOpts entities.ModifyImageDataOptions
@@ -99,7 +99,7 @@ var (
Long: modifyContainerDataDescription,
RunE: modifyContainerData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing modify-container-data`,
Example: `podman-testing modify-container-data`,
}
modifyContainerDataOpts entities.ModifyContainerDataOptions
@@ -114,7 +114,7 @@ var (
Long: removeLayerDataDescription,
RunE: removeLayerData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing remove-layer-data`,
Example: `podman-testing remove-layer-data`,
}
removeLayerDataOpts entities.RemoveLayerDataOptions
@@ -127,7 +127,7 @@ var (
Long: removeImageDataDescription,
RunE: removeImageData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing remove-image-data`,
Example: `podman-testing remove-image-data`,
}
removeImageDataOpts entities.RemoveImageDataOptions
@@ -140,7 +140,7 @@ var (
Long: removeContainerDataDescription,
RunE: removeContainerData,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing remove-container-data`,
Example: `podman-testing remove-container-data`,
}
removeContainerDataOpts entities.RemoveContainerDataOptions

View File

@@ -1,4 +1,4 @@
//go:build !remote
//go:build (linux || freebsd) && !remote
package main
@@ -21,7 +21,7 @@ var (
Long: populateLayerDescription,
RunE: populateLayer,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing populate-layer`,
Example: `podman-testing populate-layer`,
}
populateLayerOpts entities.PopulateLayerOptions
@@ -35,7 +35,7 @@ var (
Long: modifyLayerDescription,
RunE: modifyLayer,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing modify-layer`,
Example: `podman-testing modify-layer`,
}
modifyLayerOpts entities.ModifyLayerOptions

View File

@@ -1,5 +1,3 @@
//go:build !remote
package main
import (
@@ -11,13 +9,10 @@ import (
"syscall"
_ "github.com/containers/podman/v6/cmd/podman/completion"
ientities "github.com/containers/podman/v6/internal/domain/entities"
"github.com/containers/podman/v6/internal/domain/infra"
"github.com/containers/podman/v6/pkg/domain/entities"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"go.podman.io/common/pkg/config"
"go.podman.io/storage"
"go.podman.io/storage/pkg/reexec"
"go.podman.io/storage/pkg/unshare"
)
@@ -38,11 +33,9 @@ var (
SilenceUsage: true,
SilenceErrors: true,
}
mainContext = context.Background()
podmanConfig entities.PodmanConfig
globalStorageOptions storage.StoreOptions
globalLogLevel string
testingEngine ientities.TestingEngine
mainContext = context.Background()
podmanConfig entities.PodmanConfig
globalLogLevel string
)
func init() {
@@ -80,18 +73,9 @@ func before() error {
}
podmanConfig.ContainersConf = containersConf
podmanConfig.StorageDriver = globalStorageOptions.GraphDriverName
podmanConfig.GraphRoot = globalStorageOptions.GraphRoot
podmanConfig.Runroot = globalStorageOptions.RunRoot
podmanConfig.ImageStore = globalStorageOptions.ImageStore
podmanConfig.StorageOpts = globalStorageOptions.GraphDriverOptions
podmanConfig.TransientStore = globalStorageOptions.TransientStore
te, err := infra.NewTestingEngine(&podmanConfig)
if err != nil {
return fmt.Errorf("initializing libpod: %w", err)
if err := testingEngineBefore(&podmanConfig); err != nil {
return fmt.Errorf("setting up testing engine: %w", err)
}
testingEngine = te
return nil
}

View File

@@ -1,4 +1,4 @@
//go:build !remote
//go:build (linux || freebsd) && !remote
package main
@@ -20,7 +20,7 @@ var (
Long: removeStorageLayerDescription,
RunE: removeStorageLayer,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing remove-storage-layer`,
Example: `podman-testing remove-storage-layer`,
}
removeStorageLayerOpts entities.RemoveStorageLayerOptions
@@ -33,7 +33,7 @@ var (
Long: removeLayerDescription,
RunE: removeLayer,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing remove-layer`,
Example: `podman-testing remove-layer`,
}
removeLayerOpts entities.RemoveLayerOptions
@@ -46,7 +46,7 @@ var (
Long: removeImageDescription,
RunE: removeImage,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing remove-image`,
Example: `podman-testing remove-image`,
}
removeImageOpts entities.RemoveImageOptions
@@ -59,7 +59,7 @@ var (
Long: removeContainerDescription,
RunE: removeContainer,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman testing remove-container`,
Example: `podman-testing remove-container`,
}
removeContainerOpts entities.RemoveContainerOptions

View File

@@ -6,14 +6,18 @@ import (
"fmt"
"os"
ientities "github.com/containers/podman/v6/internal/domain/entities"
"github.com/containers/podman/v6/internal/domain/infra"
"github.com/containers/podman/v6/pkg/domain/entities"
"go.podman.io/storage"
"go.podman.io/storage/types"
)
var (
globalStore storage.Store
engineMode = entities.ABIMode
globalStorageOptions storage.StoreOptions
globalStore storage.Store
engineMode = entities.ABIMode
testingEngine ientities.TestingEngine
)
func init() {
@@ -52,6 +56,7 @@ func storeBefore() error {
} else {
engineMode = entities.ABIMode
}
podmanConfig.EngineMode = engineMode
return nil
}
@@ -62,3 +67,14 @@ func storeAfter() error {
}
return nil
}
func testingEngineBefore(podmanConfig *entities.PodmanConfig) (err error) {
podmanConfig.StorageDriver = globalStorageOptions.GraphDriverName
podmanConfig.GraphRoot = globalStorageOptions.GraphRoot
podmanConfig.Runroot = globalStorageOptions.RunRoot
podmanConfig.ImageStore = globalStorageOptions.ImageStore
podmanConfig.StorageOpts = globalStorageOptions.GraphDriverOptions
podmanConfig.TransientStore = globalStorageOptions.TransientStore
testingEngine, err = infra.NewTestingEngine(podmanConfig)
return err
}

View File

@@ -0,0 +1,23 @@
//go:build !(linux || freebsd) || remote
package main
import (
"github.com/containers/podman/v6/pkg/domain/entities"
)
var (
engineMode = entities.TunnelMode
)
func storeBefore() error {
return nil
}
func storeAfter() error {
return nil
}
func testingEngineBefore(_ *entities.PodmanConfig) (err error) {
return nil
}

2
go.mod
View File

@@ -72,6 +72,7 @@ require (
golang.org/x/sync v0.17.0
golang.org/x/sys v0.38.0
golang.org/x/term v0.36.0
google.golang.org/grpc v1.72.2
google.golang.org/protobuf v1.36.9
gopkg.in/inf.v0 v0.9.1
gopkg.in/yaml.v3 v3.0.1
@@ -188,7 +189,6 @@ require (
golang.org/x/tools v0.37.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
google.golang.org/grpc v1.72.2 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
tags.cncf.io/container-device-interface/specs-go v1.0.0 // indirect
)

12
pkg/api/grpcpb/build.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
set -e
cd $(dirname ${BASH_SOURCE[0]})
TOP=../../..
PATH=${TOP}/test/tools/build:${PATH}
set -x
for proto in *.proto ; do
protoc \
--go_opt=paths=source_relative --go_out . \
--go-grpc_opt=paths=source_relative --go-grpc_out . \
${proto}
done

174
pkg/api/grpcpb/noop.pb.go Normal file
View File

@@ -0,0 +1,174 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.19.6
// source: noop.proto
package grpcpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type NoopRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Ignored string `protobuf:"bytes,1,opt,name=ignored,proto3" json:"ignored,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NoopRequest) Reset() {
*x = NoopRequest{}
mi := &file_noop_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NoopRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NoopRequest) ProtoMessage() {}
func (x *NoopRequest) ProtoReflect() protoreflect.Message {
mi := &file_noop_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NoopRequest.ProtoReflect.Descriptor instead.
func (*NoopRequest) Descriptor() ([]byte, []int) {
return file_noop_proto_rawDescGZIP(), []int{0}
}
func (x *NoopRequest) GetIgnored() string {
if x != nil {
return x.Ignored
}
return ""
}
type NoopResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Ignored string `protobuf:"bytes,1,opt,name=ignored,proto3" json:"ignored,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NoopResponse) Reset() {
*x = NoopResponse{}
mi := &file_noop_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NoopResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NoopResponse) ProtoMessage() {}
func (x *NoopResponse) ProtoReflect() protoreflect.Message {
mi := &file_noop_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NoopResponse.ProtoReflect.Descriptor instead.
func (*NoopResponse) Descriptor() ([]byte, []int) {
return file_noop_proto_rawDescGZIP(), []int{1}
}
func (x *NoopResponse) GetIgnored() string {
if x != nil {
return x.Ignored
}
return ""
}
var File_noop_proto protoreflect.FileDescriptor
const file_noop_proto_rawDesc = "" +
"\n" +
"\n" +
"noop.proto\x12\fio.podman.v1\"'\n" +
"\vNoopRequest\x12\x18\n" +
"\aignored\x18\x01 \x01(\tR\aignored\"(\n" +
"\fNoopResponse\x12\x18\n" +
"\aignored\x18\x01 \x01(\tR\aignored2E\n" +
"\x04Noop\x12=\n" +
"\x04Noop\x12\x19.io.podman.v1.NoopRequest\x1a\x1a.io.podman.v1.NoopResponseB0Z.github.com/containers/podman/v6/pkg/api/grpcpbb\x06proto3"
var (
file_noop_proto_rawDescOnce sync.Once
file_noop_proto_rawDescData []byte
)
func file_noop_proto_rawDescGZIP() []byte {
file_noop_proto_rawDescOnce.Do(func() {
file_noop_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_noop_proto_rawDesc), len(file_noop_proto_rawDesc)))
})
return file_noop_proto_rawDescData
}
var file_noop_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_noop_proto_goTypes = []any{
(*NoopRequest)(nil), // 0: io.podman.v1.NoopRequest
(*NoopResponse)(nil), // 1: io.podman.v1.NoopResponse
}
var file_noop_proto_depIdxs = []int32{
0, // 0: io.podman.v1.Noop.Noop:input_type -> io.podman.v1.NoopRequest
1, // 1: io.podman.v1.Noop.Noop:output_type -> io.podman.v1.NoopResponse
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_noop_proto_init() }
func file_noop_proto_init() {
if File_noop_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_noop_proto_rawDesc), len(file_noop_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_noop_proto_goTypes,
DependencyIndexes: file_noop_proto_depIdxs,
MessageInfos: file_noop_proto_msgTypes,
}.Build()
File_noop_proto = out.File
file_noop_proto_goTypes = nil
file_noop_proto_depIdxs = nil
}

17
pkg/api/grpcpb/noop.proto Normal file
View File

@@ -0,0 +1,17 @@
syntax = "proto3";
package io.podman.v1;
option go_package = "github.com/containers/podman/v6/pkg/api/grpcpb";
service Noop {
rpc Noop(NoopRequest) returns (NoopResponse);
}
message NoopRequest {
string ignored = 1;
}
message NoopResponse {
string ignored = 1;
}

View File

@@ -0,0 +1,121 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.19.6
// source: noop.proto
package grpcpb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Noop_Noop_FullMethodName = "/io.podman.v1.Noop/Noop"
)
// NoopClient is the client API for Noop service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type NoopClient interface {
Noop(ctx context.Context, in *NoopRequest, opts ...grpc.CallOption) (*NoopResponse, error)
}
type noopClient struct {
cc grpc.ClientConnInterface
}
func NewNoopClient(cc grpc.ClientConnInterface) NoopClient {
return &noopClient{cc}
}
func (c *noopClient) Noop(ctx context.Context, in *NoopRequest, opts ...grpc.CallOption) (*NoopResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NoopResponse)
err := c.cc.Invoke(ctx, Noop_Noop_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// NoopServer is the server API for Noop service.
// All implementations must embed UnimplementedNoopServer
// for forward compatibility.
type NoopServer interface {
Noop(context.Context, *NoopRequest) (*NoopResponse, error)
mustEmbedUnimplementedNoopServer()
}
// UnimplementedNoopServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedNoopServer struct{}
func (UnimplementedNoopServer) Noop(context.Context, *NoopRequest) (*NoopResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Noop not implemented")
}
func (UnimplementedNoopServer) mustEmbedUnimplementedNoopServer() {}
func (UnimplementedNoopServer) testEmbeddedByValue() {}
// UnsafeNoopServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NoopServer will
// result in compilation errors.
type UnsafeNoopServer interface {
mustEmbedUnimplementedNoopServer()
}
func RegisterNoopServer(s grpc.ServiceRegistrar, srv NoopServer) {
// If the following call pancis, it indicates UnimplementedNoopServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Noop_ServiceDesc, srv)
}
func _Noop_Noop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NoopRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NoopServer).Noop(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Noop_Noop_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NoopServer).Noop(ctx, req.(*NoopRequest))
}
return interceptor(ctx, in, info, handler)
}
// Noop_ServiceDesc is the grpc.ServiceDesc for Noop service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Noop_ServiceDesc = grpc.ServiceDesc{
ServiceName: "io.podman.v1.Noop",
HandlerType: (*NoopServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Noop",
Handler: _Noop_Noop_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "noop.proto",
}

View File

@@ -0,0 +1,26 @@
//go:build !remote
package grpc
import (
"context"
"github.com/containers/podman/v6/libpod"
"github.com/containers/podman/v6/pkg/api/grpcpb"
)
type noopServer struct {
grpcpb.UnimplementedNoopServer
runtime *libpod.Runtime
}
func (noopServer) Noop(_ context.Context, req *grpcpb.NoopRequest) (*grpcpb.NoopResponse, error) {
resp := &grpcpb.NoopResponse{
Ignored: req.GetIgnored(),
}
return resp, nil
}
func NewNoopServer(runtime *libpod.Runtime) grpcpb.NoopServer {
return &noopServer{runtime: runtime}
}

View File

@@ -19,7 +19,9 @@ import (
"github.com/containers/podman/v6/libpod"
"github.com/containers/podman/v6/libpod/shutdown"
"github.com/containers/podman/v6/pkg/api/grpcpb"
"github.com/containers/podman/v6/pkg/api/handlers"
grpchandlers "github.com/containers/podman/v6/pkg/api/handlers/grpc"
"github.com/containers/podman/v6/pkg/api/server/idle"
"github.com/containers/podman/v6/pkg/api/types"
"github.com/containers/podman/v6/pkg/domain/entities"
@@ -28,10 +30,13 @@ import (
"github.com/gorilla/mux"
"github.com/gorilla/schema"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)
type APIServer struct {
http.Server // The HTTP work happens here
http.Server // The HTTP work happens here
grpc *grpc.Server // GRPC stuff happens here
net.Listener // mux for routing HTTP API calls to libpod routines
*libpod.Runtime // Where the real work happens
*schema.Decoder // Decoder for Query parameters to structs
@@ -71,6 +76,10 @@ func newServer(runtime *libpod.Runtime, listener net.Listener, opts entities.Ser
router := mux.NewRouter().UseEncodedPath()
tracker := idle.NewTracker(opts.Timeout)
serverProtocols := &http.Protocols{}
serverProtocols.SetHTTP1(true)
serverProtocols.SetHTTP2(true)
server := APIServer{
Server: http.Server{
ConnContext: func(ctx context.Context, c net.Conn) context.Context {
@@ -80,7 +89,9 @@ func newServer(runtime *libpod.Runtime, listener net.Listener, opts entities.Ser
ErrorLog: log.New(logrus.StandardLogger().Out, "", 0),
Handler: router,
IdleTimeout: opts.Timeout * 2,
Protocols: serverProtocols,
},
grpc: grpc.NewServer(),
CorsHeaders: opts.CorsHeaders,
Listener: listener,
PProfAddr: opts.PProfAddr,
@@ -90,6 +101,9 @@ func newServer(runtime *libpod.Runtime, listener net.Listener, opts entities.Ser
tlsClientCAFile: opts.TLSClientCAFile,
}
router.NewRoute().HeadersRegexp("Content-Type", "application/grpc(\\+.*)?").Handler(server.grpc)
reflection.Register(server.grpc)
server.BaseContext = func(_ net.Listener) context.Context {
ctx := context.WithValue(context.Background(), types.DecoderKey, handlers.NewAPIDecoder())
ctx = context.WithValue(ctx, types.CompatDecoderKey, handlers.NewCompatAPIDecoder())
@@ -161,6 +175,8 @@ func newServer(runtime *libpod.Runtime, listener net.Listener, opts entities.Ser
}
}
grpcpb.RegisterNoopServer(server.grpc, grpchandlers.NewNoopServer(runtime)) // TODO: make this table-driven instead of a one-off?
if logrus.IsLevelEnabled(logrus.TraceLevel) {
// If in trace mode log request and response bodies
router.Use(loggingHandler())
@@ -211,6 +227,7 @@ func (s *APIServer) Serve() error {
s.setupPprof()
if err := shutdown.Register("service", func(_ os.Signal) error {
s.grpc.GracefulStop()
err := s.Shutdown(true)
if err == nil {
// For `systemctl stop podman.service` support, exit code should be 0
@@ -245,6 +262,7 @@ func (s *APIServer) Serve() error {
}
err = s.Server.ServeTLS(s.Listener, s.tlsCertFile, s.tlsKeyFile)
} else {
s.Server.Protocols.SetUnencryptedHTTP2(true)
err = s.Server.Serve(s.Listener)
}
if err != nil && err != http.ErrServerClosed {

View File

@@ -46,6 +46,24 @@ function _podman_system_service {
rm -f $PODMAN_TMPDIR/myunix.sock
}
@test "podman system service: grpc listener" {
unset REMOTESYSTEM_TRANSPORT
skip_if_remote "podman system service unavailable over remote"
URL=unix://$PODMAN_TMPDIR/myunix.sock
_podman_system_service $URL --time=0
wait_for_file $PODMAN_TMPDIR/myunix.sock
nonce=$RANDOM
run_podman_testing --url "$URL" noop '{"ignored":"'$nonce'"}'
assert $status -eq 0
is $(jq -c <<< "$output") '{"ignored":"'$nonce'"}' "noop responder"
systemctl stop $SERVICE_NAME
rm -f $PODMAN_TMPDIR/myunix.sock
}
@test "podman-system-service containers survive service stop" {
unset REMOTESYSTEM_TRANSPORT

18
vendor/google.golang.org/grpc/reflection/README.md generated vendored Normal file
View File

@@ -0,0 +1,18 @@
# Reflection
Package reflection implements server reflection service.
The service implemented is defined in: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1/reflection.proto.
To register server reflection on a gRPC server:
```go
import "google.golang.org/grpc/reflection"
s := grpc.NewServer()
pb.RegisterYourOwnServer(s, &server{})
// Register reflection service on gRPC server.
reflection.Register(s)
s.Serve(lis)
```

57
vendor/google.golang.org/grpc/reflection/adapt.go generated vendored Normal file
View File

@@ -0,0 +1,57 @@
/*
*
* Copyright 2023 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package reflection
import (
"google.golang.org/grpc/reflection/internal"
v1reflectiongrpc "google.golang.org/grpc/reflection/grpc_reflection_v1"
v1reflectionpb "google.golang.org/grpc/reflection/grpc_reflection_v1"
v1alphareflectiongrpc "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"
)
// asV1Alpha returns an implementation of the v1alpha version of the reflection
// interface that delegates all calls to the given v1 version.
func asV1Alpha(svr v1reflectiongrpc.ServerReflectionServer) v1alphareflectiongrpc.ServerReflectionServer {
return v1AlphaServerImpl{svr: svr}
}
type v1AlphaServerImpl struct {
svr v1reflectiongrpc.ServerReflectionServer
}
func (s v1AlphaServerImpl) ServerReflectionInfo(stream v1alphareflectiongrpc.ServerReflection_ServerReflectionInfoServer) error {
return s.svr.ServerReflectionInfo(v1AlphaServerStreamAdapter{stream})
}
type v1AlphaServerStreamAdapter struct {
v1alphareflectiongrpc.ServerReflection_ServerReflectionInfoServer
}
func (s v1AlphaServerStreamAdapter) Send(response *v1reflectionpb.ServerReflectionResponse) error {
return s.ServerReflection_ServerReflectionInfoServer.Send(internal.V1ToV1AlphaResponse(response))
}
func (s v1AlphaServerStreamAdapter) Recv() (*v1reflectionpb.ServerReflectionRequest, error) {
resp, err := s.ServerReflection_ServerReflectionInfoServer.Recv()
if err != nil {
return nil, err
}
return internal.V1AlphaToV1Request(resp), nil
}

View File

@@ -0,0 +1,849 @@
// Copyright 2016 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Service exported by server reflection. A more complete description of how
// server reflection works can be found at
// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md
//
// The canonical version of this proto can be found at
// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.5
// protoc v5.27.1
// source: grpc/reflection/v1/reflection.proto
package grpc_reflection_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// The message sent by the client when calling ServerReflectionInfo method.
type ServerReflectionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
// To use reflection service, the client should set one of the following
// fields in message_request. The server distinguishes requests by their
// defined field and then handles them using corresponding methods.
//
// Types that are valid to be assigned to MessageRequest:
//
// *ServerReflectionRequest_FileByFilename
// *ServerReflectionRequest_FileContainingSymbol
// *ServerReflectionRequest_FileContainingExtension
// *ServerReflectionRequest_AllExtensionNumbersOfType
// *ServerReflectionRequest_ListServices
MessageRequest isServerReflectionRequest_MessageRequest `protobuf_oneof:"message_request"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ServerReflectionRequest) Reset() {
*x = ServerReflectionRequest{}
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ServerReflectionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServerReflectionRequest) ProtoMessage() {}
func (x *ServerReflectionRequest) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServerReflectionRequest.ProtoReflect.Descriptor instead.
func (*ServerReflectionRequest) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{0}
}
func (x *ServerReflectionRequest) GetHost() string {
if x != nil {
return x.Host
}
return ""
}
func (x *ServerReflectionRequest) GetMessageRequest() isServerReflectionRequest_MessageRequest {
if x != nil {
return x.MessageRequest
}
return nil
}
func (x *ServerReflectionRequest) GetFileByFilename() string {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_FileByFilename); ok {
return x.FileByFilename
}
}
return ""
}
func (x *ServerReflectionRequest) GetFileContainingSymbol() string {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_FileContainingSymbol); ok {
return x.FileContainingSymbol
}
}
return ""
}
func (x *ServerReflectionRequest) GetFileContainingExtension() *ExtensionRequest {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_FileContainingExtension); ok {
return x.FileContainingExtension
}
}
return nil
}
func (x *ServerReflectionRequest) GetAllExtensionNumbersOfType() string {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_AllExtensionNumbersOfType); ok {
return x.AllExtensionNumbersOfType
}
}
return ""
}
func (x *ServerReflectionRequest) GetListServices() string {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_ListServices); ok {
return x.ListServices
}
}
return ""
}
type isServerReflectionRequest_MessageRequest interface {
isServerReflectionRequest_MessageRequest()
}
type ServerReflectionRequest_FileByFilename struct {
// Find a proto file by the file name.
FileByFilename string `protobuf:"bytes,3,opt,name=file_by_filename,json=fileByFilename,proto3,oneof"`
}
type ServerReflectionRequest_FileContainingSymbol struct {
// Find the proto file that declares the given fully-qualified symbol name.
// This field should be a fully-qualified symbol name
// (e.g. <package>.<service>[.<method>] or <package>.<type>).
FileContainingSymbol string `protobuf:"bytes,4,opt,name=file_containing_symbol,json=fileContainingSymbol,proto3,oneof"`
}
type ServerReflectionRequest_FileContainingExtension struct {
// Find the proto file which defines an extension extending the given
// message type with the given field number.
FileContainingExtension *ExtensionRequest `protobuf:"bytes,5,opt,name=file_containing_extension,json=fileContainingExtension,proto3,oneof"`
}
type ServerReflectionRequest_AllExtensionNumbersOfType struct {
// Finds the tag numbers used by all known extensions of the given message
// type, and appends them to ExtensionNumberResponse in an undefined order.
// Its corresponding method is best-effort: it's not guaranteed that the
// reflection service will implement this method, and it's not guaranteed
// that this method will provide all extensions. Returns
// StatusCode::UNIMPLEMENTED if it's not implemented.
// This field should be a fully-qualified type name. The format is
// <package>.<type>
AllExtensionNumbersOfType string `protobuf:"bytes,6,opt,name=all_extension_numbers_of_type,json=allExtensionNumbersOfType,proto3,oneof"`
}
type ServerReflectionRequest_ListServices struct {
// List the full names of registered services. The content will not be
// checked.
ListServices string `protobuf:"bytes,7,opt,name=list_services,json=listServices,proto3,oneof"`
}
func (*ServerReflectionRequest_FileByFilename) isServerReflectionRequest_MessageRequest() {}
func (*ServerReflectionRequest_FileContainingSymbol) isServerReflectionRequest_MessageRequest() {}
func (*ServerReflectionRequest_FileContainingExtension) isServerReflectionRequest_MessageRequest() {}
func (*ServerReflectionRequest_AllExtensionNumbersOfType) isServerReflectionRequest_MessageRequest() {
}
func (*ServerReflectionRequest_ListServices) isServerReflectionRequest_MessageRequest() {}
// The type name and extension number sent by the client when requesting
// file_containing_extension.
type ExtensionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Fully-qualified type name. The format should be <package>.<type>
ContainingType string `protobuf:"bytes,1,opt,name=containing_type,json=containingType,proto3" json:"containing_type,omitempty"`
ExtensionNumber int32 `protobuf:"varint,2,opt,name=extension_number,json=extensionNumber,proto3" json:"extension_number,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ExtensionRequest) Reset() {
*x = ExtensionRequest{}
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ExtensionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtensionRequest) ProtoMessage() {}
func (x *ExtensionRequest) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExtensionRequest.ProtoReflect.Descriptor instead.
func (*ExtensionRequest) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{1}
}
func (x *ExtensionRequest) GetContainingType() string {
if x != nil {
return x.ContainingType
}
return ""
}
func (x *ExtensionRequest) GetExtensionNumber() int32 {
if x != nil {
return x.ExtensionNumber
}
return 0
}
// The message sent by the server to answer ServerReflectionInfo method.
type ServerReflectionResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
ValidHost string `protobuf:"bytes,1,opt,name=valid_host,json=validHost,proto3" json:"valid_host,omitempty"`
OriginalRequest *ServerReflectionRequest `protobuf:"bytes,2,opt,name=original_request,json=originalRequest,proto3" json:"original_request,omitempty"`
// The server sets one of the following fields according to the message_request
// in the request.
//
// Types that are valid to be assigned to MessageResponse:
//
// *ServerReflectionResponse_FileDescriptorResponse
// *ServerReflectionResponse_AllExtensionNumbersResponse
// *ServerReflectionResponse_ListServicesResponse
// *ServerReflectionResponse_ErrorResponse
MessageResponse isServerReflectionResponse_MessageResponse `protobuf_oneof:"message_response"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ServerReflectionResponse) Reset() {
*x = ServerReflectionResponse{}
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ServerReflectionResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServerReflectionResponse) ProtoMessage() {}
func (x *ServerReflectionResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServerReflectionResponse.ProtoReflect.Descriptor instead.
func (*ServerReflectionResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{2}
}
func (x *ServerReflectionResponse) GetValidHost() string {
if x != nil {
return x.ValidHost
}
return ""
}
func (x *ServerReflectionResponse) GetOriginalRequest() *ServerReflectionRequest {
if x != nil {
return x.OriginalRequest
}
return nil
}
func (x *ServerReflectionResponse) GetMessageResponse() isServerReflectionResponse_MessageResponse {
if x != nil {
return x.MessageResponse
}
return nil
}
func (x *ServerReflectionResponse) GetFileDescriptorResponse() *FileDescriptorResponse {
if x != nil {
if x, ok := x.MessageResponse.(*ServerReflectionResponse_FileDescriptorResponse); ok {
return x.FileDescriptorResponse
}
}
return nil
}
func (x *ServerReflectionResponse) GetAllExtensionNumbersResponse() *ExtensionNumberResponse {
if x != nil {
if x, ok := x.MessageResponse.(*ServerReflectionResponse_AllExtensionNumbersResponse); ok {
return x.AllExtensionNumbersResponse
}
}
return nil
}
func (x *ServerReflectionResponse) GetListServicesResponse() *ListServiceResponse {
if x != nil {
if x, ok := x.MessageResponse.(*ServerReflectionResponse_ListServicesResponse); ok {
return x.ListServicesResponse
}
}
return nil
}
func (x *ServerReflectionResponse) GetErrorResponse() *ErrorResponse {
if x != nil {
if x, ok := x.MessageResponse.(*ServerReflectionResponse_ErrorResponse); ok {
return x.ErrorResponse
}
}
return nil
}
type isServerReflectionResponse_MessageResponse interface {
isServerReflectionResponse_MessageResponse()
}
type ServerReflectionResponse_FileDescriptorResponse struct {
// This message is used to answer file_by_filename, file_containing_symbol,
// file_containing_extension requests with transitive dependencies.
// As the repeated label is not allowed in oneof fields, we use a
// FileDescriptorResponse message to encapsulate the repeated fields.
// The reflection service is allowed to avoid sending FileDescriptorProtos
// that were previously sent in response to earlier requests in the stream.
FileDescriptorResponse *FileDescriptorResponse `protobuf:"bytes,4,opt,name=file_descriptor_response,json=fileDescriptorResponse,proto3,oneof"`
}
type ServerReflectionResponse_AllExtensionNumbersResponse struct {
// This message is used to answer all_extension_numbers_of_type requests.
AllExtensionNumbersResponse *ExtensionNumberResponse `protobuf:"bytes,5,opt,name=all_extension_numbers_response,json=allExtensionNumbersResponse,proto3,oneof"`
}
type ServerReflectionResponse_ListServicesResponse struct {
// This message is used to answer list_services requests.
ListServicesResponse *ListServiceResponse `protobuf:"bytes,6,opt,name=list_services_response,json=listServicesResponse,proto3,oneof"`
}
type ServerReflectionResponse_ErrorResponse struct {
// This message is used when an error occurs.
ErrorResponse *ErrorResponse `protobuf:"bytes,7,opt,name=error_response,json=errorResponse,proto3,oneof"`
}
func (*ServerReflectionResponse_FileDescriptorResponse) isServerReflectionResponse_MessageResponse() {
}
func (*ServerReflectionResponse_AllExtensionNumbersResponse) isServerReflectionResponse_MessageResponse() {
}
func (*ServerReflectionResponse_ListServicesResponse) isServerReflectionResponse_MessageResponse() {}
func (*ServerReflectionResponse_ErrorResponse) isServerReflectionResponse_MessageResponse() {}
// Serialized FileDescriptorProto messages sent by the server answering
// a file_by_filename, file_containing_symbol, or file_containing_extension
// request.
type FileDescriptorResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Serialized FileDescriptorProto messages. We avoid taking a dependency on
// descriptor.proto, which uses proto2 only features, by making them opaque
// bytes instead.
FileDescriptorProto [][]byte `protobuf:"bytes,1,rep,name=file_descriptor_proto,json=fileDescriptorProto,proto3" json:"file_descriptor_proto,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *FileDescriptorResponse) Reset() {
*x = FileDescriptorResponse{}
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *FileDescriptorResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FileDescriptorResponse) ProtoMessage() {}
func (x *FileDescriptorResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FileDescriptorResponse.ProtoReflect.Descriptor instead.
func (*FileDescriptorResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{3}
}
func (x *FileDescriptorResponse) GetFileDescriptorProto() [][]byte {
if x != nil {
return x.FileDescriptorProto
}
return nil
}
// A list of extension numbers sent by the server answering
// all_extension_numbers_of_type request.
type ExtensionNumberResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Full name of the base type, including the package name. The format
// is <package>.<type>
BaseTypeName string `protobuf:"bytes,1,opt,name=base_type_name,json=baseTypeName,proto3" json:"base_type_name,omitempty"`
ExtensionNumber []int32 `protobuf:"varint,2,rep,packed,name=extension_number,json=extensionNumber,proto3" json:"extension_number,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ExtensionNumberResponse) Reset() {
*x = ExtensionNumberResponse{}
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ExtensionNumberResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtensionNumberResponse) ProtoMessage() {}
func (x *ExtensionNumberResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExtensionNumberResponse.ProtoReflect.Descriptor instead.
func (*ExtensionNumberResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{4}
}
func (x *ExtensionNumberResponse) GetBaseTypeName() string {
if x != nil {
return x.BaseTypeName
}
return ""
}
func (x *ExtensionNumberResponse) GetExtensionNumber() []int32 {
if x != nil {
return x.ExtensionNumber
}
return nil
}
// A list of ServiceResponse sent by the server answering list_services request.
type ListServiceResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The information of each service may be expanded in the future, so we use
// ServiceResponse message to encapsulate it.
Service []*ServiceResponse `protobuf:"bytes,1,rep,name=service,proto3" json:"service,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListServiceResponse) Reset() {
*x = ListServiceResponse{}
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListServiceResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListServiceResponse) ProtoMessage() {}
func (x *ListServiceResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListServiceResponse.ProtoReflect.Descriptor instead.
func (*ListServiceResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{5}
}
func (x *ListServiceResponse) GetService() []*ServiceResponse {
if x != nil {
return x.Service
}
return nil
}
// The information of a single service used by ListServiceResponse to answer
// list_services request.
type ServiceResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Full name of a registered service, including its package name. The format
// is <package>.<service>
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ServiceResponse) Reset() {
*x = ServiceResponse{}
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ServiceResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServiceResponse) ProtoMessage() {}
func (x *ServiceResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServiceResponse.ProtoReflect.Descriptor instead.
func (*ServiceResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{6}
}
func (x *ServiceResponse) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The error code and error message sent by the server when an error occurs.
type ErrorResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// This field uses the error codes defined in grpc::StatusCode.
ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ErrorResponse) Reset() {
*x = ErrorResponse{}
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ErrorResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ErrorResponse) ProtoMessage() {}
func (x *ErrorResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.
func (*ErrorResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{7}
}
func (x *ErrorResponse) GetErrorCode() int32 {
if x != nil {
return x.ErrorCode
}
return 0
}
func (x *ErrorResponse) GetErrorMessage() string {
if x != nil {
return x.ErrorMessage
}
return ""
}
var File_grpc_reflection_v1_reflection_proto protoreflect.FileDescriptor
var file_grpc_reflection_v1_reflection_proto_rawDesc = string([]byte{
0x0a, 0x23, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0xf3, 0x02, 0x0a, 0x17, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x69, 0x6c,
0x65, 0x5f, 0x62, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x79, 0x46, 0x69, 0x6c,
0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x16, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x14, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e,
0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x62, 0x0a,
0x19, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67,
0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x42, 0x0a, 0x1d, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x79,
0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x19, 0x61, 0x6c, 0x6c, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x4f,
0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c,
0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22,
0x66, 0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e,
0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10,
0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xae, 0x04, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x6f,
0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x48,
0x6f, 0x73, 0x74, 0x12, 0x56, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e,
0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67,
0x69, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x66, 0x0a, 0x18, 0x66,
0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x72,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x16, 0x66, 0x69, 0x6c,
0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x1e, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e,
0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x72, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x72,
0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x1b, 0x61, 0x6c, 0x6c, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x5f,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72,
0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x48, 0x00, 0x52, 0x14, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f,
0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x46, 0x69, 0x6c, 0x65,
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0c, 0x52, 0x13, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x17, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x54,
0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e,
0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28,
0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62,
0x65, 0x72, 0x22, 0x54, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x73, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x72, 0x70,
0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52,
0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
0x53, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x32, 0x89, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52,
0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x75, 0x0a, 0x14, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x2b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c,
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01,
0x42, 0x66, 0x0a, 0x15, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x15, 0x53, 0x65, 0x72, 0x76, 0x65,
0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x34, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e,
0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x6c, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var (
file_grpc_reflection_v1_reflection_proto_rawDescOnce sync.Once
file_grpc_reflection_v1_reflection_proto_rawDescData []byte
)
func file_grpc_reflection_v1_reflection_proto_rawDescGZIP() []byte {
file_grpc_reflection_v1_reflection_proto_rawDescOnce.Do(func() {
file_grpc_reflection_v1_reflection_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_grpc_reflection_v1_reflection_proto_rawDesc), len(file_grpc_reflection_v1_reflection_proto_rawDesc)))
})
return file_grpc_reflection_v1_reflection_proto_rawDescData
}
var file_grpc_reflection_v1_reflection_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_grpc_reflection_v1_reflection_proto_goTypes = []any{
(*ServerReflectionRequest)(nil), // 0: grpc.reflection.v1.ServerReflectionRequest
(*ExtensionRequest)(nil), // 1: grpc.reflection.v1.ExtensionRequest
(*ServerReflectionResponse)(nil), // 2: grpc.reflection.v1.ServerReflectionResponse
(*FileDescriptorResponse)(nil), // 3: grpc.reflection.v1.FileDescriptorResponse
(*ExtensionNumberResponse)(nil), // 4: grpc.reflection.v1.ExtensionNumberResponse
(*ListServiceResponse)(nil), // 5: grpc.reflection.v1.ListServiceResponse
(*ServiceResponse)(nil), // 6: grpc.reflection.v1.ServiceResponse
(*ErrorResponse)(nil), // 7: grpc.reflection.v1.ErrorResponse
}
var file_grpc_reflection_v1_reflection_proto_depIdxs = []int32{
1, // 0: grpc.reflection.v1.ServerReflectionRequest.file_containing_extension:type_name -> grpc.reflection.v1.ExtensionRequest
0, // 1: grpc.reflection.v1.ServerReflectionResponse.original_request:type_name -> grpc.reflection.v1.ServerReflectionRequest
3, // 2: grpc.reflection.v1.ServerReflectionResponse.file_descriptor_response:type_name -> grpc.reflection.v1.FileDescriptorResponse
4, // 3: grpc.reflection.v1.ServerReflectionResponse.all_extension_numbers_response:type_name -> grpc.reflection.v1.ExtensionNumberResponse
5, // 4: grpc.reflection.v1.ServerReflectionResponse.list_services_response:type_name -> grpc.reflection.v1.ListServiceResponse
7, // 5: grpc.reflection.v1.ServerReflectionResponse.error_response:type_name -> grpc.reflection.v1.ErrorResponse
6, // 6: grpc.reflection.v1.ListServiceResponse.service:type_name -> grpc.reflection.v1.ServiceResponse
0, // 7: grpc.reflection.v1.ServerReflection.ServerReflectionInfo:input_type -> grpc.reflection.v1.ServerReflectionRequest
2, // 8: grpc.reflection.v1.ServerReflection.ServerReflectionInfo:output_type -> grpc.reflection.v1.ServerReflectionResponse
8, // [8:9] is the sub-list for method output_type
7, // [7:8] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_grpc_reflection_v1_reflection_proto_init() }
func file_grpc_reflection_v1_reflection_proto_init() {
if File_grpc_reflection_v1_reflection_proto != nil {
return
}
file_grpc_reflection_v1_reflection_proto_msgTypes[0].OneofWrappers = []any{
(*ServerReflectionRequest_FileByFilename)(nil),
(*ServerReflectionRequest_FileContainingSymbol)(nil),
(*ServerReflectionRequest_FileContainingExtension)(nil),
(*ServerReflectionRequest_AllExtensionNumbersOfType)(nil),
(*ServerReflectionRequest_ListServices)(nil),
}
file_grpc_reflection_v1_reflection_proto_msgTypes[2].OneofWrappers = []any{
(*ServerReflectionResponse_FileDescriptorResponse)(nil),
(*ServerReflectionResponse_AllExtensionNumbersResponse)(nil),
(*ServerReflectionResponse_ListServicesResponse)(nil),
(*ServerReflectionResponse_ErrorResponse)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_grpc_reflection_v1_reflection_proto_rawDesc), len(file_grpc_reflection_v1_reflection_proto_rawDesc)),
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_grpc_reflection_v1_reflection_proto_goTypes,
DependencyIndexes: file_grpc_reflection_v1_reflection_proto_depIdxs,
MessageInfos: file_grpc_reflection_v1_reflection_proto_msgTypes,
}.Build()
File_grpc_reflection_v1_reflection_proto = out.File
file_grpc_reflection_v1_reflection_proto_goTypes = nil
file_grpc_reflection_v1_reflection_proto_depIdxs = nil
}

View File

@@ -0,0 +1,138 @@
// Copyright 2016 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Service exported by server reflection. A more complete description of how
// server reflection works can be found at
// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md
//
// The canonical version of this proto can be found at
// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.27.1
// source: grpc/reflection/v1/reflection.proto
package grpc_reflection_v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ServerReflection_ServerReflectionInfo_FullMethodName = "/grpc.reflection.v1.ServerReflection/ServerReflectionInfo"
)
// ServerReflectionClient is the client API for ServerReflection service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ServerReflectionClient interface {
// The reflection service is structured as a bidirectional stream, ensuring
// all related requests go to a single server.
ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ServerReflectionRequest, ServerReflectionResponse], error)
}
type serverReflectionClient struct {
cc grpc.ClientConnInterface
}
func NewServerReflectionClient(cc grpc.ClientConnInterface) ServerReflectionClient {
return &serverReflectionClient{cc}
}
func (c *serverReflectionClient) ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ServerReflectionRequest, ServerReflectionResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ServerReflection_ServiceDesc.Streams[0], ServerReflection_ServerReflectionInfo_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[ServerReflectionRequest, ServerReflectionResponse]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ServerReflection_ServerReflectionInfoClient = grpc.BidiStreamingClient[ServerReflectionRequest, ServerReflectionResponse]
// ServerReflectionServer is the server API for ServerReflection service.
// All implementations should embed UnimplementedServerReflectionServer
// for forward compatibility.
type ServerReflectionServer interface {
// The reflection service is structured as a bidirectional stream, ensuring
// all related requests go to a single server.
ServerReflectionInfo(grpc.BidiStreamingServer[ServerReflectionRequest, ServerReflectionResponse]) error
}
// UnimplementedServerReflectionServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedServerReflectionServer struct{}
func (UnimplementedServerReflectionServer) ServerReflectionInfo(grpc.BidiStreamingServer[ServerReflectionRequest, ServerReflectionResponse]) error {
return status.Errorf(codes.Unimplemented, "method ServerReflectionInfo not implemented")
}
func (UnimplementedServerReflectionServer) testEmbeddedByValue() {}
// UnsafeServerReflectionServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ServerReflectionServer will
// result in compilation errors.
type UnsafeServerReflectionServer interface {
mustEmbedUnimplementedServerReflectionServer()
}
func RegisterServerReflectionServer(s grpc.ServiceRegistrar, srv ServerReflectionServer) {
// If the following call panics, it indicates UnimplementedServerReflectionServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ServerReflection_ServiceDesc, srv)
}
func _ServerReflection_ServerReflectionInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ServerReflectionServer).ServerReflectionInfo(&grpc.GenericServerStream[ServerReflectionRequest, ServerReflectionResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ServerReflection_ServerReflectionInfoServer = grpc.BidiStreamingServer[ServerReflectionRequest, ServerReflectionResponse]
// ServerReflection_ServiceDesc is the grpc.ServiceDesc for ServerReflection service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ServerReflection_ServiceDesc = grpc.ServiceDesc{
ServiceName: "grpc.reflection.v1.ServerReflection",
HandlerType: (*ServerReflectionServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "ServerReflectionInfo",
Handler: _ServerReflection_ServerReflectionInfo_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "grpc/reflection/v1/reflection.proto",
}

View File

@@ -0,0 +1,924 @@
// Copyright 2016 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Service exported by server reflection
// Warning: this entire file is deprecated. Use this instead:
// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.5
// protoc v5.27.1
// grpc/reflection/v1alpha/reflection.proto is a deprecated file.
package grpc_reflection_v1alpha
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// The message sent by the client when calling ServerReflectionInfo method.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
type ServerReflectionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
// To use reflection service, the client should set one of the following
// fields in message_request. The server distinguishes requests by their
// defined field and then handles them using corresponding methods.
//
// Types that are valid to be assigned to MessageRequest:
//
// *ServerReflectionRequest_FileByFilename
// *ServerReflectionRequest_FileContainingSymbol
// *ServerReflectionRequest_FileContainingExtension
// *ServerReflectionRequest_AllExtensionNumbersOfType
// *ServerReflectionRequest_ListServices
MessageRequest isServerReflectionRequest_MessageRequest `protobuf_oneof:"message_request"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ServerReflectionRequest) Reset() {
*x = ServerReflectionRequest{}
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ServerReflectionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServerReflectionRequest) ProtoMessage() {}
func (x *ServerReflectionRequest) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServerReflectionRequest.ProtoReflect.Descriptor instead.
func (*ServerReflectionRequest) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{0}
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionRequest) GetHost() string {
if x != nil {
return x.Host
}
return ""
}
func (x *ServerReflectionRequest) GetMessageRequest() isServerReflectionRequest_MessageRequest {
if x != nil {
return x.MessageRequest
}
return nil
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionRequest) GetFileByFilename() string {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_FileByFilename); ok {
return x.FileByFilename
}
}
return ""
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionRequest) GetFileContainingSymbol() string {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_FileContainingSymbol); ok {
return x.FileContainingSymbol
}
}
return ""
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionRequest) GetFileContainingExtension() *ExtensionRequest {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_FileContainingExtension); ok {
return x.FileContainingExtension
}
}
return nil
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionRequest) GetAllExtensionNumbersOfType() string {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_AllExtensionNumbersOfType); ok {
return x.AllExtensionNumbersOfType
}
}
return ""
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionRequest) GetListServices() string {
if x != nil {
if x, ok := x.MessageRequest.(*ServerReflectionRequest_ListServices); ok {
return x.ListServices
}
}
return ""
}
type isServerReflectionRequest_MessageRequest interface {
isServerReflectionRequest_MessageRequest()
}
type ServerReflectionRequest_FileByFilename struct {
// Find a proto file by the file name.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
FileByFilename string `protobuf:"bytes,3,opt,name=file_by_filename,json=fileByFilename,proto3,oneof"`
}
type ServerReflectionRequest_FileContainingSymbol struct {
// Find the proto file that declares the given fully-qualified symbol name.
// This field should be a fully-qualified symbol name
// (e.g. <package>.<service>[.<method>] or <package>.<type>).
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
FileContainingSymbol string `protobuf:"bytes,4,opt,name=file_containing_symbol,json=fileContainingSymbol,proto3,oneof"`
}
type ServerReflectionRequest_FileContainingExtension struct {
// Find the proto file which defines an extension extending the given
// message type with the given field number.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
FileContainingExtension *ExtensionRequest `protobuf:"bytes,5,opt,name=file_containing_extension,json=fileContainingExtension,proto3,oneof"`
}
type ServerReflectionRequest_AllExtensionNumbersOfType struct {
// Finds the tag numbers used by all known extensions of extendee_type, and
// appends them to ExtensionNumberResponse in an undefined order.
// Its corresponding method is best-effort: it's not guaranteed that the
// reflection service will implement this method, and it's not guaranteed
// that this method will provide all extensions. Returns
// StatusCode::UNIMPLEMENTED if it's not implemented.
// This field should be a fully-qualified type name. The format is
// <package>.<type>
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
AllExtensionNumbersOfType string `protobuf:"bytes,6,opt,name=all_extension_numbers_of_type,json=allExtensionNumbersOfType,proto3,oneof"`
}
type ServerReflectionRequest_ListServices struct {
// List the full names of registered services. The content will not be
// checked.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ListServices string `protobuf:"bytes,7,opt,name=list_services,json=listServices,proto3,oneof"`
}
func (*ServerReflectionRequest_FileByFilename) isServerReflectionRequest_MessageRequest() {}
func (*ServerReflectionRequest_FileContainingSymbol) isServerReflectionRequest_MessageRequest() {}
func (*ServerReflectionRequest_FileContainingExtension) isServerReflectionRequest_MessageRequest() {}
func (*ServerReflectionRequest_AllExtensionNumbersOfType) isServerReflectionRequest_MessageRequest() {
}
func (*ServerReflectionRequest_ListServices) isServerReflectionRequest_MessageRequest() {}
// The type name and extension number sent by the client when requesting
// file_containing_extension.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
type ExtensionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Fully-qualified type name. The format should be <package>.<type>
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ContainingType string `protobuf:"bytes,1,opt,name=containing_type,json=containingType,proto3" json:"containing_type,omitempty"`
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ExtensionNumber int32 `protobuf:"varint,2,opt,name=extension_number,json=extensionNumber,proto3" json:"extension_number,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ExtensionRequest) Reset() {
*x = ExtensionRequest{}
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ExtensionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtensionRequest) ProtoMessage() {}
func (x *ExtensionRequest) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExtensionRequest.ProtoReflect.Descriptor instead.
func (*ExtensionRequest) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{1}
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ExtensionRequest) GetContainingType() string {
if x != nil {
return x.ContainingType
}
return ""
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ExtensionRequest) GetExtensionNumber() int32 {
if x != nil {
return x.ExtensionNumber
}
return 0
}
// The message sent by the server to answer ServerReflectionInfo method.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
type ServerReflectionResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ValidHost string `protobuf:"bytes,1,opt,name=valid_host,json=validHost,proto3" json:"valid_host,omitempty"`
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
OriginalRequest *ServerReflectionRequest `protobuf:"bytes,2,opt,name=original_request,json=originalRequest,proto3" json:"original_request,omitempty"`
// The server set one of the following fields according to the message_request
// in the request.
//
// Types that are valid to be assigned to MessageResponse:
//
// *ServerReflectionResponse_FileDescriptorResponse
// *ServerReflectionResponse_AllExtensionNumbersResponse
// *ServerReflectionResponse_ListServicesResponse
// *ServerReflectionResponse_ErrorResponse
MessageResponse isServerReflectionResponse_MessageResponse `protobuf_oneof:"message_response"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ServerReflectionResponse) Reset() {
*x = ServerReflectionResponse{}
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ServerReflectionResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServerReflectionResponse) ProtoMessage() {}
func (x *ServerReflectionResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServerReflectionResponse.ProtoReflect.Descriptor instead.
func (*ServerReflectionResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{2}
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionResponse) GetValidHost() string {
if x != nil {
return x.ValidHost
}
return ""
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionResponse) GetOriginalRequest() *ServerReflectionRequest {
if x != nil {
return x.OriginalRequest
}
return nil
}
func (x *ServerReflectionResponse) GetMessageResponse() isServerReflectionResponse_MessageResponse {
if x != nil {
return x.MessageResponse
}
return nil
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionResponse) GetFileDescriptorResponse() *FileDescriptorResponse {
if x != nil {
if x, ok := x.MessageResponse.(*ServerReflectionResponse_FileDescriptorResponse); ok {
return x.FileDescriptorResponse
}
}
return nil
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionResponse) GetAllExtensionNumbersResponse() *ExtensionNumberResponse {
if x != nil {
if x, ok := x.MessageResponse.(*ServerReflectionResponse_AllExtensionNumbersResponse); ok {
return x.AllExtensionNumbersResponse
}
}
return nil
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionResponse) GetListServicesResponse() *ListServiceResponse {
if x != nil {
if x, ok := x.MessageResponse.(*ServerReflectionResponse_ListServicesResponse); ok {
return x.ListServicesResponse
}
}
return nil
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServerReflectionResponse) GetErrorResponse() *ErrorResponse {
if x != nil {
if x, ok := x.MessageResponse.(*ServerReflectionResponse_ErrorResponse); ok {
return x.ErrorResponse
}
}
return nil
}
type isServerReflectionResponse_MessageResponse interface {
isServerReflectionResponse_MessageResponse()
}
type ServerReflectionResponse_FileDescriptorResponse struct {
// This message is used to answer file_by_filename, file_containing_symbol,
// file_containing_extension requests with transitive dependencies. As
// the repeated label is not allowed in oneof fields, we use a
// FileDescriptorResponse message to encapsulate the repeated fields.
// The reflection service is allowed to avoid sending FileDescriptorProtos
// that were previously sent in response to earlier requests in the stream.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
FileDescriptorResponse *FileDescriptorResponse `protobuf:"bytes,4,opt,name=file_descriptor_response,json=fileDescriptorResponse,proto3,oneof"`
}
type ServerReflectionResponse_AllExtensionNumbersResponse struct {
// This message is used to answer all_extension_numbers_of_type request.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
AllExtensionNumbersResponse *ExtensionNumberResponse `protobuf:"bytes,5,opt,name=all_extension_numbers_response,json=allExtensionNumbersResponse,proto3,oneof"`
}
type ServerReflectionResponse_ListServicesResponse struct {
// This message is used to answer list_services request.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ListServicesResponse *ListServiceResponse `protobuf:"bytes,6,opt,name=list_services_response,json=listServicesResponse,proto3,oneof"`
}
type ServerReflectionResponse_ErrorResponse struct {
// This message is used when an error occurs.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ErrorResponse *ErrorResponse `protobuf:"bytes,7,opt,name=error_response,json=errorResponse,proto3,oneof"`
}
func (*ServerReflectionResponse_FileDescriptorResponse) isServerReflectionResponse_MessageResponse() {
}
func (*ServerReflectionResponse_AllExtensionNumbersResponse) isServerReflectionResponse_MessageResponse() {
}
func (*ServerReflectionResponse_ListServicesResponse) isServerReflectionResponse_MessageResponse() {}
func (*ServerReflectionResponse_ErrorResponse) isServerReflectionResponse_MessageResponse() {}
// Serialized FileDescriptorProto messages sent by the server answering
// a file_by_filename, file_containing_symbol, or file_containing_extension
// request.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
type FileDescriptorResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Serialized FileDescriptorProto messages. We avoid taking a dependency on
// descriptor.proto, which uses proto2 only features, by making them opaque
// bytes instead.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
FileDescriptorProto [][]byte `protobuf:"bytes,1,rep,name=file_descriptor_proto,json=fileDescriptorProto,proto3" json:"file_descriptor_proto,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *FileDescriptorResponse) Reset() {
*x = FileDescriptorResponse{}
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *FileDescriptorResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FileDescriptorResponse) ProtoMessage() {}
func (x *FileDescriptorResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FileDescriptorResponse.ProtoReflect.Descriptor instead.
func (*FileDescriptorResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{3}
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *FileDescriptorResponse) GetFileDescriptorProto() [][]byte {
if x != nil {
return x.FileDescriptorProto
}
return nil
}
// A list of extension numbers sent by the server answering
// all_extension_numbers_of_type request.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
type ExtensionNumberResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Full name of the base type, including the package name. The format
// is <package>.<type>
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
BaseTypeName string `protobuf:"bytes,1,opt,name=base_type_name,json=baseTypeName,proto3" json:"base_type_name,omitempty"`
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ExtensionNumber []int32 `protobuf:"varint,2,rep,packed,name=extension_number,json=extensionNumber,proto3" json:"extension_number,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ExtensionNumberResponse) Reset() {
*x = ExtensionNumberResponse{}
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ExtensionNumberResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExtensionNumberResponse) ProtoMessage() {}
func (x *ExtensionNumberResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExtensionNumberResponse.ProtoReflect.Descriptor instead.
func (*ExtensionNumberResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{4}
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ExtensionNumberResponse) GetBaseTypeName() string {
if x != nil {
return x.BaseTypeName
}
return ""
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ExtensionNumberResponse) GetExtensionNumber() []int32 {
if x != nil {
return x.ExtensionNumber
}
return nil
}
// A list of ServiceResponse sent by the server answering list_services request.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
type ListServiceResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The information of each service may be expanded in the future, so we use
// ServiceResponse message to encapsulate it.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
Service []*ServiceResponse `protobuf:"bytes,1,rep,name=service,proto3" json:"service,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListServiceResponse) Reset() {
*x = ListServiceResponse{}
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListServiceResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListServiceResponse) ProtoMessage() {}
func (x *ListServiceResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListServiceResponse.ProtoReflect.Descriptor instead.
func (*ListServiceResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{5}
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ListServiceResponse) GetService() []*ServiceResponse {
if x != nil {
return x.Service
}
return nil
}
// The information of a single service used by ListServiceResponse to answer
// list_services request.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
type ServiceResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Full name of a registered service, including its package name. The format
// is <package>.<service>
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ServiceResponse) Reset() {
*x = ServiceResponse{}
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ServiceResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServiceResponse) ProtoMessage() {}
func (x *ServiceResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServiceResponse.ProtoReflect.Descriptor instead.
func (*ServiceResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{6}
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ServiceResponse) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The error code and error message sent by the server when an error occurs.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
type ErrorResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// This field uses the error codes defined in grpc::StatusCode.
//
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ErrorResponse) Reset() {
*x = ErrorResponse{}
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ErrorResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ErrorResponse) ProtoMessage() {}
func (x *ErrorResponse) ProtoReflect() protoreflect.Message {
mi := &file_grpc_reflection_v1alpha_reflection_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.
func (*ErrorResponse) Descriptor() ([]byte, []int) {
return file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{7}
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ErrorResponse) GetErrorCode() int32 {
if x != nil {
return x.ErrorCode
}
return 0
}
// Deprecated: The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated.
func (x *ErrorResponse) GetErrorMessage() string {
if x != nil {
return x.ErrorMessage
}
return ""
}
var File_grpc_reflection_v1alpha_reflection_proto protoreflect.FileDescriptor
var file_grpc_reflection_v1alpha_reflection_proto_rawDesc = string([]byte{
0x0a, 0x28, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x67, 0x72, 0x70, 0x63,
0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c,
0x70, 0x68, 0x61, 0x22, 0xf8, 0x02, 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65,
0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68,
0x6f, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x66,
0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
0x0e, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x36, 0x0a, 0x16, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69,
0x6e, 0x67, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48,
0x00, 0x52, 0x14, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e,
0x67, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x67, 0x0a, 0x19, 0x66, 0x69, 0x6c, 0x65, 0x5f,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e,
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x72, 0x70,
0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61,
0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e,
0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x42, 0x0a, 0x1d, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x79, 0x70,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x19, 0x61, 0x6c, 0x6c, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x4f, 0x66,
0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x6c,
0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x66,
0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67,
0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e,
0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xc7, 0x04, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, 0x65,
0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x6f, 0x73,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x6f,
0x73, 0x74, 0x12, 0x5b, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x72,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67,
0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76,
0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0f,
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x6b, 0x0a, 0x18, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x65,
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x48, 0x00, 0x52, 0x16, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x77, 0x0a, 0x1e,
0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75,
0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x1b, 0x61, 0x6c, 0x6c, 0x45, 0x78, 0x74,
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18,
0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x14, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x07, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x72,
0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x4c, 0x0a, 0x16, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x66, 0x69,
0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x13, 0x66, 0x69, 0x6c, 0x65, 0x44,
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a,
0x0a, 0x17, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65,
0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x61, 0x73,
0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x29, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d,
0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e,
0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x13, 0x4c, 0x69,
0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x42, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x0d,
0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a,
0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d,
0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x32, 0x93, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7f, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30,
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52,
0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65,
0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x73, 0x0a, 0x1a, 0x69, 0x6f, 0x2e, 0x67, 0x72,
0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x42, 0x15, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66,
0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72,
0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xb8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
})
var (
file_grpc_reflection_v1alpha_reflection_proto_rawDescOnce sync.Once
file_grpc_reflection_v1alpha_reflection_proto_rawDescData []byte
)
func file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP() []byte {
file_grpc_reflection_v1alpha_reflection_proto_rawDescOnce.Do(func() {
file_grpc_reflection_v1alpha_reflection_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_grpc_reflection_v1alpha_reflection_proto_rawDesc), len(file_grpc_reflection_v1alpha_reflection_proto_rawDesc)))
})
return file_grpc_reflection_v1alpha_reflection_proto_rawDescData
}
var file_grpc_reflection_v1alpha_reflection_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_grpc_reflection_v1alpha_reflection_proto_goTypes = []any{
(*ServerReflectionRequest)(nil), // 0: grpc.reflection.v1alpha.ServerReflectionRequest
(*ExtensionRequest)(nil), // 1: grpc.reflection.v1alpha.ExtensionRequest
(*ServerReflectionResponse)(nil), // 2: grpc.reflection.v1alpha.ServerReflectionResponse
(*FileDescriptorResponse)(nil), // 3: grpc.reflection.v1alpha.FileDescriptorResponse
(*ExtensionNumberResponse)(nil), // 4: grpc.reflection.v1alpha.ExtensionNumberResponse
(*ListServiceResponse)(nil), // 5: grpc.reflection.v1alpha.ListServiceResponse
(*ServiceResponse)(nil), // 6: grpc.reflection.v1alpha.ServiceResponse
(*ErrorResponse)(nil), // 7: grpc.reflection.v1alpha.ErrorResponse
}
var file_grpc_reflection_v1alpha_reflection_proto_depIdxs = []int32{
1, // 0: grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension:type_name -> grpc.reflection.v1alpha.ExtensionRequest
0, // 1: grpc.reflection.v1alpha.ServerReflectionResponse.original_request:type_name -> grpc.reflection.v1alpha.ServerReflectionRequest
3, // 2: grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response:type_name -> grpc.reflection.v1alpha.FileDescriptorResponse
4, // 3: grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response:type_name -> grpc.reflection.v1alpha.ExtensionNumberResponse
5, // 4: grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response:type_name -> grpc.reflection.v1alpha.ListServiceResponse
7, // 5: grpc.reflection.v1alpha.ServerReflectionResponse.error_response:type_name -> grpc.reflection.v1alpha.ErrorResponse
6, // 6: grpc.reflection.v1alpha.ListServiceResponse.service:type_name -> grpc.reflection.v1alpha.ServiceResponse
0, // 7: grpc.reflection.v1alpha.ServerReflection.ServerReflectionInfo:input_type -> grpc.reflection.v1alpha.ServerReflectionRequest
2, // 8: grpc.reflection.v1alpha.ServerReflection.ServerReflectionInfo:output_type -> grpc.reflection.v1alpha.ServerReflectionResponse
8, // [8:9] is the sub-list for method output_type
7, // [7:8] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_grpc_reflection_v1alpha_reflection_proto_init() }
func file_grpc_reflection_v1alpha_reflection_proto_init() {
if File_grpc_reflection_v1alpha_reflection_proto != nil {
return
}
file_grpc_reflection_v1alpha_reflection_proto_msgTypes[0].OneofWrappers = []any{
(*ServerReflectionRequest_FileByFilename)(nil),
(*ServerReflectionRequest_FileContainingSymbol)(nil),
(*ServerReflectionRequest_FileContainingExtension)(nil),
(*ServerReflectionRequest_AllExtensionNumbersOfType)(nil),
(*ServerReflectionRequest_ListServices)(nil),
}
file_grpc_reflection_v1alpha_reflection_proto_msgTypes[2].OneofWrappers = []any{
(*ServerReflectionResponse_FileDescriptorResponse)(nil),
(*ServerReflectionResponse_AllExtensionNumbersResponse)(nil),
(*ServerReflectionResponse_ListServicesResponse)(nil),
(*ServerReflectionResponse_ErrorResponse)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_grpc_reflection_v1alpha_reflection_proto_rawDesc), len(file_grpc_reflection_v1alpha_reflection_proto_rawDesc)),
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_grpc_reflection_v1alpha_reflection_proto_goTypes,
DependencyIndexes: file_grpc_reflection_v1alpha_reflection_proto_depIdxs,
MessageInfos: file_grpc_reflection_v1alpha_reflection_proto_msgTypes,
}.Build()
File_grpc_reflection_v1alpha_reflection_proto = out.File
file_grpc_reflection_v1alpha_reflection_proto_goTypes = nil
file_grpc_reflection_v1alpha_reflection_proto_depIdxs = nil
}

View File

@@ -0,0 +1,135 @@
// Copyright 2016 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Service exported by server reflection
// Warning: this entire file is deprecated. Use this instead:
// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.27.1
// grpc/reflection/v1alpha/reflection.proto is a deprecated file.
package grpc_reflection_v1alpha
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ServerReflection_ServerReflectionInfo_FullMethodName = "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"
)
// ServerReflectionClient is the client API for ServerReflection service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ServerReflectionClient interface {
// The reflection service is structured as a bidirectional stream, ensuring
// all related requests go to a single server.
ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ServerReflectionRequest, ServerReflectionResponse], error)
}
type serverReflectionClient struct {
cc grpc.ClientConnInterface
}
func NewServerReflectionClient(cc grpc.ClientConnInterface) ServerReflectionClient {
return &serverReflectionClient{cc}
}
func (c *serverReflectionClient) ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ServerReflectionRequest, ServerReflectionResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ServerReflection_ServiceDesc.Streams[0], ServerReflection_ServerReflectionInfo_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[ServerReflectionRequest, ServerReflectionResponse]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ServerReflection_ServerReflectionInfoClient = grpc.BidiStreamingClient[ServerReflectionRequest, ServerReflectionResponse]
// ServerReflectionServer is the server API for ServerReflection service.
// All implementations should embed UnimplementedServerReflectionServer
// for forward compatibility.
type ServerReflectionServer interface {
// The reflection service is structured as a bidirectional stream, ensuring
// all related requests go to a single server.
ServerReflectionInfo(grpc.BidiStreamingServer[ServerReflectionRequest, ServerReflectionResponse]) error
}
// UnimplementedServerReflectionServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedServerReflectionServer struct{}
func (UnimplementedServerReflectionServer) ServerReflectionInfo(grpc.BidiStreamingServer[ServerReflectionRequest, ServerReflectionResponse]) error {
return status.Errorf(codes.Unimplemented, "method ServerReflectionInfo not implemented")
}
func (UnimplementedServerReflectionServer) testEmbeddedByValue() {}
// UnsafeServerReflectionServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ServerReflectionServer will
// result in compilation errors.
type UnsafeServerReflectionServer interface {
mustEmbedUnimplementedServerReflectionServer()
}
func RegisterServerReflectionServer(s grpc.ServiceRegistrar, srv ServerReflectionServer) {
// If the following call panics, it indicates UnimplementedServerReflectionServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ServerReflection_ServiceDesc, srv)
}
func _ServerReflection_ServerReflectionInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ServerReflectionServer).ServerReflectionInfo(&grpc.GenericServerStream[ServerReflectionRequest, ServerReflectionResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ServerReflection_ServerReflectionInfoServer = grpc.BidiStreamingServer[ServerReflectionRequest, ServerReflectionResponse]
// ServerReflection_ServiceDesc is the grpc.ServiceDesc for ServerReflection service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ServerReflection_ServiceDesc = grpc.ServiceDesc{
ServiceName: "grpc.reflection.v1alpha.ServerReflection",
HandlerType: (*ServerReflectionServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "ServerReflectionInfo",
Handler: _ServerReflection_ServerReflectionInfo_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "grpc/reflection/v1alpha/reflection.proto",
}

View File

@@ -0,0 +1,436 @@
/*
*
* Copyright 2024 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// 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
// dependency to deprecated package github.com/golang/protobuf.
package internal
import (
"io"
"sort"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protodesc"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
v1reflectiongrpc "google.golang.org/grpc/reflection/grpc_reflection_v1"
v1reflectionpb "google.golang.org/grpc/reflection/grpc_reflection_v1"
v1alphareflectiongrpc "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"
v1alphareflectionpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"
)
// ServiceInfoProvider is an interface used to retrieve metadata about the
// services to expose.
type ServiceInfoProvider interface {
GetServiceInfo() map[string]grpc.ServiceInfo
}
// ExtensionResolver is the interface used to query details about extensions.
// This interface is satisfied by protoregistry.GlobalTypes.
type ExtensionResolver interface {
protoregistry.ExtensionTypeResolver
RangeExtensionsByMessage(message protoreflect.FullName, f func(protoreflect.ExtensionType) bool)
}
// ServerReflectionServer is the server API for ServerReflection service.
type ServerReflectionServer struct {
v1alphareflectiongrpc.UnimplementedServerReflectionServer
S ServiceInfoProvider
DescResolver protodesc.Resolver
ExtResolver ExtensionResolver
}
// 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 (s *ServerReflectionServer) FileDescWithDependencies(fd protoreflect.FileDescriptor, sentFileDescriptors map[string]bool) ([][]byte, error) {
if fd.IsPlaceholder() {
// If the given root file is a placeholder, treat it
// as missing instead of serializing it.
return nil, protoregistry.NotFound
}
var r [][]byte
queue := []protoreflect.FileDescriptor{fd}
for len(queue) > 0 {
currentfd := queue[0]
queue = queue[1:]
if currentfd.IsPlaceholder() {
// Skip any missing files in the dependency graph.
continue
}
if sent := sentFileDescriptors[currentfd.Path()]; len(r) == 0 || !sent {
sentFileDescriptors[currentfd.Path()] = true
fdProto := protodesc.ToFileDescriptorProto(currentfd)
currentfdEncoded, err := proto.Marshal(fdProto)
if err != nil {
return nil, err
}
r = append(r, currentfdEncoded)
}
for i := 0; i < currentfd.Imports().Len(); i++ {
queue = append(queue, currentfd.Imports().Get(i))
}
}
return r, nil
}
// 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 (s *ServerReflectionServer) FileDescEncodingContainingSymbol(name string, sentFileDescriptors map[string]bool) ([][]byte, error) {
d, err := s.DescResolver.FindDescriptorByName(protoreflect.FullName(name))
if err != nil {
return nil, err
}
return s.FileDescWithDependencies(d.ParentFile(), sentFileDescriptors)
}
// 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 (s *ServerReflectionServer) FileDescEncodingContainingExtension(typeName string, extNum int32, sentFileDescriptors map[string]bool) ([][]byte, error) {
xt, err := s.ExtResolver.FindExtensionByNumber(protoreflect.FullName(typeName), protoreflect.FieldNumber(extNum))
if err != nil {
return nil, err
}
return s.FileDescWithDependencies(xt.TypeDescriptor().ParentFile(), sentFileDescriptors)
}
// AllExtensionNumbersForTypeName returns all extension numbers for the given type.
func (s *ServerReflectionServer) AllExtensionNumbersForTypeName(name string) ([]int32, error) {
var numbers []int32
s.ExtResolver.RangeExtensionsByMessage(protoreflect.FullName(name), func(xt protoreflect.ExtensionType) bool {
numbers = append(numbers, int32(xt.TypeDescriptor().Number()))
return true
})
sort.Slice(numbers, func(i, j int) bool {
return numbers[i] < numbers[j]
})
if len(numbers) == 0 {
// maybe return an error if given type name is not known
if _, err := s.DescResolver.FindDescriptorByName(protoreflect.FullName(name)); err != nil {
return nil, err
}
}
return numbers, nil
}
// ListServices returns the names of services this server exposes.
func (s *ServerReflectionServer) ListServices() []*v1reflectionpb.ServiceResponse {
serviceInfo := s.S.GetServiceInfo()
resp := make([]*v1reflectionpb.ServiceResponse, 0, len(serviceInfo))
for svc := range serviceInfo {
resp = append(resp, &v1reflectionpb.ServiceResponse{Name: svc})
}
sort.Slice(resp, func(i, j int) bool {
return resp[i].Name < resp[j].Name
})
return resp
}
// ServerReflectionInfo is the reflection service handler.
func (s *ServerReflectionServer) ServerReflectionInfo(stream v1reflectiongrpc.ServerReflection_ServerReflectionInfoServer) error {
sentFileDescriptors := make(map[string]bool)
for {
in, err := stream.Recv()
if err == io.EOF {
return nil
}
if err != nil {
return err
}
out := &v1reflectionpb.ServerReflectionResponse{
ValidHost: in.Host,
OriginalRequest: in,
}
switch req := in.MessageRequest.(type) {
case *v1reflectionpb.ServerReflectionRequest_FileByFilename:
var b [][]byte
fd, err := s.DescResolver.FindFileByPath(req.FileByFilename)
if err == nil {
b, err = s.FileDescWithDependencies(fd, sentFileDescriptors)
}
if err != nil {
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_ErrorResponse{
ErrorResponse: &v1reflectionpb.ErrorResponse{
ErrorCode: int32(codes.NotFound),
ErrorMessage: err.Error(),
},
}
} else {
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_FileDescriptorResponse{
FileDescriptorResponse: &v1reflectionpb.FileDescriptorResponse{FileDescriptorProto: b},
}
}
case *v1reflectionpb.ServerReflectionRequest_FileContainingSymbol:
b, err := s.FileDescEncodingContainingSymbol(req.FileContainingSymbol, sentFileDescriptors)
if err != nil {
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_ErrorResponse{
ErrorResponse: &v1reflectionpb.ErrorResponse{
ErrorCode: int32(codes.NotFound),
ErrorMessage: err.Error(),
},
}
} else {
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_FileDescriptorResponse{
FileDescriptorResponse: &v1reflectionpb.FileDescriptorResponse{FileDescriptorProto: b},
}
}
case *v1reflectionpb.ServerReflectionRequest_FileContainingExtension:
typeName := req.FileContainingExtension.ContainingType
extNum := req.FileContainingExtension.ExtensionNumber
b, err := s.FileDescEncodingContainingExtension(typeName, extNum, sentFileDescriptors)
if err != nil {
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_ErrorResponse{
ErrorResponse: &v1reflectionpb.ErrorResponse{
ErrorCode: int32(codes.NotFound),
ErrorMessage: err.Error(),
},
}
} else {
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_FileDescriptorResponse{
FileDescriptorResponse: &v1reflectionpb.FileDescriptorResponse{FileDescriptorProto: b},
}
}
case *v1reflectionpb.ServerReflectionRequest_AllExtensionNumbersOfType:
extNums, err := s.AllExtensionNumbersForTypeName(req.AllExtensionNumbersOfType)
if err != nil {
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_ErrorResponse{
ErrorResponse: &v1reflectionpb.ErrorResponse{
ErrorCode: int32(codes.NotFound),
ErrorMessage: err.Error(),
},
}
} else {
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_AllExtensionNumbersResponse{
AllExtensionNumbersResponse: &v1reflectionpb.ExtensionNumberResponse{
BaseTypeName: req.AllExtensionNumbersOfType,
ExtensionNumber: extNums,
},
}
}
case *v1reflectionpb.ServerReflectionRequest_ListServices:
out.MessageResponse = &v1reflectionpb.ServerReflectionResponse_ListServicesResponse{
ListServicesResponse: &v1reflectionpb.ListServiceResponse{
Service: s.ListServices(),
},
}
default:
return status.Errorf(codes.InvalidArgument, "invalid MessageRequest: %v", in.MessageRequest)
}
if err := stream.Send(out); err != nil {
return err
}
}
}
// V1ToV1AlphaResponse converts a v1 ServerReflectionResponse to a v1alpha.
func V1ToV1AlphaResponse(v1 *v1reflectionpb.ServerReflectionResponse) *v1alphareflectionpb.ServerReflectionResponse {
var v1alpha v1alphareflectionpb.ServerReflectionResponse
v1alpha.ValidHost = v1.ValidHost
if v1.OriginalRequest != nil {
v1alpha.OriginalRequest = V1ToV1AlphaRequest(v1.OriginalRequest)
}
switch mr := v1.MessageResponse.(type) {
case *v1reflectionpb.ServerReflectionResponse_FileDescriptorResponse:
if mr != nil {
v1alpha.MessageResponse = &v1alphareflectionpb.ServerReflectionResponse_FileDescriptorResponse{
FileDescriptorResponse: &v1alphareflectionpb.FileDescriptorResponse{
FileDescriptorProto: mr.FileDescriptorResponse.GetFileDescriptorProto(),
},
}
}
case *v1reflectionpb.ServerReflectionResponse_AllExtensionNumbersResponse:
if mr != nil {
v1alpha.MessageResponse = &v1alphareflectionpb.ServerReflectionResponse_AllExtensionNumbersResponse{
AllExtensionNumbersResponse: &v1alphareflectionpb.ExtensionNumberResponse{
BaseTypeName: mr.AllExtensionNumbersResponse.GetBaseTypeName(),
ExtensionNumber: mr.AllExtensionNumbersResponse.GetExtensionNumber(),
},
}
}
case *v1reflectionpb.ServerReflectionResponse_ListServicesResponse:
if mr != nil {
svcs := make([]*v1alphareflectionpb.ServiceResponse, len(mr.ListServicesResponse.GetService()))
for i, svc := range mr.ListServicesResponse.GetService() {
svcs[i] = &v1alphareflectionpb.ServiceResponse{
Name: svc.GetName(),
}
}
v1alpha.MessageResponse = &v1alphareflectionpb.ServerReflectionResponse_ListServicesResponse{
ListServicesResponse: &v1alphareflectionpb.ListServiceResponse{
Service: svcs,
},
}
}
case *v1reflectionpb.ServerReflectionResponse_ErrorResponse:
if mr != nil {
v1alpha.MessageResponse = &v1alphareflectionpb.ServerReflectionResponse_ErrorResponse{
ErrorResponse: &v1alphareflectionpb.ErrorResponse{
ErrorCode: mr.ErrorResponse.GetErrorCode(),
ErrorMessage: mr.ErrorResponse.GetErrorMessage(),
},
}
}
default:
// no value set
}
return &v1alpha
}
// V1AlphaToV1Request converts a v1alpha ServerReflectionRequest to a v1.
func V1AlphaToV1Request(v1alpha *v1alphareflectionpb.ServerReflectionRequest) *v1reflectionpb.ServerReflectionRequest {
var v1 v1reflectionpb.ServerReflectionRequest
v1.Host = v1alpha.Host
switch mr := v1alpha.MessageRequest.(type) {
case *v1alphareflectionpb.ServerReflectionRequest_FileByFilename:
v1.MessageRequest = &v1reflectionpb.ServerReflectionRequest_FileByFilename{
FileByFilename: mr.FileByFilename,
}
case *v1alphareflectionpb.ServerReflectionRequest_FileContainingSymbol:
v1.MessageRequest = &v1reflectionpb.ServerReflectionRequest_FileContainingSymbol{
FileContainingSymbol: mr.FileContainingSymbol,
}
case *v1alphareflectionpb.ServerReflectionRequest_FileContainingExtension:
if mr.FileContainingExtension != nil {
v1.MessageRequest = &v1reflectionpb.ServerReflectionRequest_FileContainingExtension{
FileContainingExtension: &v1reflectionpb.ExtensionRequest{
ContainingType: mr.FileContainingExtension.GetContainingType(),
ExtensionNumber: mr.FileContainingExtension.GetExtensionNumber(),
},
}
}
case *v1alphareflectionpb.ServerReflectionRequest_AllExtensionNumbersOfType:
v1.MessageRequest = &v1reflectionpb.ServerReflectionRequest_AllExtensionNumbersOfType{
AllExtensionNumbersOfType: mr.AllExtensionNumbersOfType,
}
case *v1alphareflectionpb.ServerReflectionRequest_ListServices:
v1.MessageRequest = &v1reflectionpb.ServerReflectionRequest_ListServices{
ListServices: mr.ListServices,
}
default:
// no value set
}
return &v1
}
// V1ToV1AlphaRequest converts a v1 ServerReflectionRequest to a v1alpha.
func V1ToV1AlphaRequest(v1 *v1reflectionpb.ServerReflectionRequest) *v1alphareflectionpb.ServerReflectionRequest {
var v1alpha v1alphareflectionpb.ServerReflectionRequest
v1alpha.Host = v1.Host
switch mr := v1.MessageRequest.(type) {
case *v1reflectionpb.ServerReflectionRequest_FileByFilename:
if mr != nil {
v1alpha.MessageRequest = &v1alphareflectionpb.ServerReflectionRequest_FileByFilename{
FileByFilename: mr.FileByFilename,
}
}
case *v1reflectionpb.ServerReflectionRequest_FileContainingSymbol:
if mr != nil {
v1alpha.MessageRequest = &v1alphareflectionpb.ServerReflectionRequest_FileContainingSymbol{
FileContainingSymbol: mr.FileContainingSymbol,
}
}
case *v1reflectionpb.ServerReflectionRequest_FileContainingExtension:
if mr != nil {
v1alpha.MessageRequest = &v1alphareflectionpb.ServerReflectionRequest_FileContainingExtension{
FileContainingExtension: &v1alphareflectionpb.ExtensionRequest{
ContainingType: mr.FileContainingExtension.GetContainingType(),
ExtensionNumber: mr.FileContainingExtension.GetExtensionNumber(),
},
}
}
case *v1reflectionpb.ServerReflectionRequest_AllExtensionNumbersOfType:
if mr != nil {
v1alpha.MessageRequest = &v1alphareflectionpb.ServerReflectionRequest_AllExtensionNumbersOfType{
AllExtensionNumbersOfType: mr.AllExtensionNumbersOfType,
}
}
case *v1reflectionpb.ServerReflectionRequest_ListServices:
if mr != nil {
v1alpha.MessageRequest = &v1alphareflectionpb.ServerReflectionRequest_ListServices{
ListServices: mr.ListServices,
}
}
default:
// no value set
}
return &v1alpha
}
// V1AlphaToV1Response converts a v1alpha ServerReflectionResponse to a v1.
func V1AlphaToV1Response(v1alpha *v1alphareflectionpb.ServerReflectionResponse) *v1reflectionpb.ServerReflectionResponse {
var v1 v1reflectionpb.ServerReflectionResponse
v1.ValidHost = v1alpha.ValidHost
if v1alpha.OriginalRequest != nil {
v1.OriginalRequest = V1AlphaToV1Request(v1alpha.OriginalRequest)
}
switch mr := v1alpha.MessageResponse.(type) {
case *v1alphareflectionpb.ServerReflectionResponse_FileDescriptorResponse:
if mr != nil {
v1.MessageResponse = &v1reflectionpb.ServerReflectionResponse_FileDescriptorResponse{
FileDescriptorResponse: &v1reflectionpb.FileDescriptorResponse{
FileDescriptorProto: mr.FileDescriptorResponse.GetFileDescriptorProto(),
},
}
}
case *v1alphareflectionpb.ServerReflectionResponse_AllExtensionNumbersResponse:
if mr != nil {
v1.MessageResponse = &v1reflectionpb.ServerReflectionResponse_AllExtensionNumbersResponse{
AllExtensionNumbersResponse: &v1reflectionpb.ExtensionNumberResponse{
BaseTypeName: mr.AllExtensionNumbersResponse.GetBaseTypeName(),
ExtensionNumber: mr.AllExtensionNumbersResponse.GetExtensionNumber(),
},
}
}
case *v1alphareflectionpb.ServerReflectionResponse_ListServicesResponse:
if mr != nil {
svcs := make([]*v1reflectionpb.ServiceResponse, len(mr.ListServicesResponse.GetService()))
for i, svc := range mr.ListServicesResponse.GetService() {
svcs[i] = &v1reflectionpb.ServiceResponse{
Name: svc.GetName(),
}
}
v1.MessageResponse = &v1reflectionpb.ServerReflectionResponse_ListServicesResponse{
ListServicesResponse: &v1reflectionpb.ListServiceResponse{
Service: svcs,
},
}
}
case *v1alphareflectionpb.ServerReflectionResponse_ErrorResponse:
if mr != nil {
v1.MessageResponse = &v1reflectionpb.ServerReflectionResponse_ErrorResponse{
ErrorResponse: &v1reflectionpb.ErrorResponse{
ErrorCode: mr.ErrorResponse.GetErrorCode(),
ErrorMessage: mr.ErrorResponse.GetErrorMessage(),
},
}
}
default:
// no value set
}
return &v1
}

View File

@@ -0,0 +1,160 @@
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
Package reflection implements server reflection service.
The service implemented is defined in:
https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto.
To register server reflection on a gRPC server:
import "google.golang.org/grpc/reflection"
s := grpc.NewServer()
pb.RegisterYourOwnServer(s, &server{})
// Register reflection service on gRPC server.
reflection.Register(s)
s.Serve(lis)
*/
package reflection // import "google.golang.org/grpc/reflection"
import (
"google.golang.org/grpc"
"google.golang.org/grpc/reflection/internal"
"google.golang.org/protobuf/reflect/protodesc"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
v1reflectiongrpc "google.golang.org/grpc/reflection/grpc_reflection_v1"
v1alphareflectiongrpc "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"
)
// GRPCServer is the interface provided by a gRPC server. It is implemented by
// *grpc.Server, but could also be implemented by other concrete types. It acts
// as a registry, for accumulating the services exposed by the server.
type GRPCServer interface {
grpc.ServiceRegistrar
ServiceInfoProvider
}
var _ GRPCServer = (*grpc.Server)(nil)
// Register registers the server reflection service on the given gRPC server.
// Both the v1 and v1alpha versions are registered.
func Register(s GRPCServer) {
svr := NewServerV1(ServerOptions{Services: s})
v1alphareflectiongrpc.RegisterServerReflectionServer(s, asV1Alpha(svr))
v1reflectiongrpc.RegisterServerReflectionServer(s, svr)
}
// RegisterV1 registers only the v1 version of the server reflection service
// on the given gRPC server. Many clients may only support v1alpha so most
// users should use Register instead, at least until clients have upgraded.
func RegisterV1(s GRPCServer) {
svr := NewServerV1(ServerOptions{Services: s})
v1reflectiongrpc.RegisterServerReflectionServer(s, svr)
}
// ServiceInfoProvider is an interface used to retrieve metadata about the
// services to expose.
//
// The reflection service is only interested in the service names, but the
// signature is this way so that *grpc.Server implements it. So it is okay
// for a custom implementation to return zero values for the
// grpc.ServiceInfo values in the map.
//
// # Experimental
//
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
// later release.
type ServiceInfoProvider interface {
GetServiceInfo() map[string]grpc.ServiceInfo
}
// ExtensionResolver is the interface used to query details about extensions.
// This interface is satisfied by protoregistry.GlobalTypes.
//
// # Experimental
//
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
// later release.
type ExtensionResolver interface {
protoregistry.ExtensionTypeResolver
RangeExtensionsByMessage(message protoreflect.FullName, f func(protoreflect.ExtensionType) bool)
}
// ServerOptions represents the options used to construct a reflection server.
//
// # Experimental
//
// Notice: This type is EXPERIMENTAL and may be changed or removed in a
// later release.
type ServerOptions struct {
// The source of advertised RPC services. If not specified, the reflection
// server will report an empty list when asked to list services.
//
// This value will typically be a *grpc.Server. But the set of advertised
// services can be customized by wrapping a *grpc.Server or using an
// alternate implementation that returns a custom set of service names.
Services ServiceInfoProvider
// Optional resolver used to load descriptors. If not specified,
// protoregistry.GlobalFiles will be used.
DescriptorResolver protodesc.Resolver
// Optional resolver used to query for known extensions. If not specified,
// protoregistry.GlobalTypes will be used.
ExtensionResolver ExtensionResolver
}
// NewServer returns a reflection server implementation using the given options.
// This can be used to customize behavior of the reflection service. Most usages
// should prefer to use Register instead. For backwards compatibility reasons,
// this returns the v1alpha version of the reflection server. For a v1 version
// of the reflection server, see NewServerV1.
//
// # Experimental
//
// Notice: This function is EXPERIMENTAL and may be changed or removed in a
// later release.
func NewServer(opts ServerOptions) v1alphareflectiongrpc.ServerReflectionServer {
return asV1Alpha(NewServerV1(opts))
}
// NewServerV1 returns a reflection server implementation using the given options.
// This can be used to customize behavior of the reflection service. Most usages
// should prefer to use Register instead.
//
// # Experimental
//
// Notice: This function is EXPERIMENTAL and may be changed or removed in a
// later release.
func NewServerV1(opts ServerOptions) v1reflectiongrpc.ServerReflectionServer {
if opts.DescriptorResolver == nil {
opts.DescriptorResolver = protoregistry.GlobalFiles
}
if opts.ExtensionResolver == nil {
opts.ExtensionResolver = protoregistry.GlobalTypes
}
return &internal.ServerReflectionServer{
S: opts.Services,
DescResolver: opts.DescriptorResolver,
ExtResolver: opts.ExtensionResolver,
}
}

4
vendor/modules.txt vendored
View File

@@ -1133,6 +1133,10 @@ google.golang.org/grpc/keepalive
google.golang.org/grpc/mem
google.golang.org/grpc/metadata
google.golang.org/grpc/peer
google.golang.org/grpc/reflection
google.golang.org/grpc/reflection/grpc_reflection_v1
google.golang.org/grpc/reflection/grpc_reflection_v1alpha
google.golang.org/grpc/reflection/internal
google.golang.org/grpc/resolver
google.golang.org/grpc/resolver/dns
google.golang.org/grpc/serviceconfig