google.golang.org/grpc@v1.62.1/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go (about)

     1  // Copyright 2016 The gRPC Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  // Service exported by server reflection
    15  
    16  // Warning: this entire file is deprecated. Use this instead:
    17  // https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
    18  
    19  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    20  // versions:
    21  // - protoc-gen-go-grpc v1.3.0
    22  // - protoc             v4.25.2
    23  // grpc/reflection/v1alpha/reflection.proto is a deprecated file.
    24  
    25  package grpc_reflection_v1alpha
    26  
    27  import (
    28  	context "context"
    29  	grpc "google.golang.org/grpc"
    30  	codes "google.golang.org/grpc/codes"
    31  	status "google.golang.org/grpc/status"
    32  )
    33  
    34  // This is a compile-time assertion to ensure that this generated file
    35  // is compatible with the grpc package it is being compiled against.
    36  // Requires gRPC-Go v1.32.0 or later.
    37  const _ = grpc.SupportPackageIsVersion7
    38  
    39  const (
    40  	ServerReflection_ServerReflectionInfo_FullMethodName = "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"
    41  )
    42  
    43  // ServerReflectionClient is the client API for ServerReflection service.
    44  //
    45  // 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.
    46  type ServerReflectionClient interface {
    47  	// The reflection service is structured as a bidirectional stream, ensuring
    48  	// all related requests go to a single server.
    49  	ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error)
    50  }
    51  
    52  type serverReflectionClient struct {
    53  	cc grpc.ClientConnInterface
    54  }
    55  
    56  func NewServerReflectionClient(cc grpc.ClientConnInterface) ServerReflectionClient {
    57  	return &serverReflectionClient{cc}
    58  }
    59  
    60  func (c *serverReflectionClient) ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error) {
    61  	stream, err := c.cc.NewStream(ctx, &ServerReflection_ServiceDesc.Streams[0], ServerReflection_ServerReflectionInfo_FullMethodName, opts...)
    62  	if err != nil {
    63  		return nil, err
    64  	}
    65  	x := &serverReflectionServerReflectionInfoClient{stream}
    66  	return x, nil
    67  }
    68  
    69  type ServerReflection_ServerReflectionInfoClient interface {
    70  	Send(*ServerReflectionRequest) error
    71  	Recv() (*ServerReflectionResponse, error)
    72  	grpc.ClientStream
    73  }
    74  
    75  type serverReflectionServerReflectionInfoClient struct {
    76  	grpc.ClientStream
    77  }
    78  
    79  func (x *serverReflectionServerReflectionInfoClient) Send(m *ServerReflectionRequest) error {
    80  	return x.ClientStream.SendMsg(m)
    81  }
    82  
    83  func (x *serverReflectionServerReflectionInfoClient) Recv() (*ServerReflectionResponse, error) {
    84  	m := new(ServerReflectionResponse)
    85  	if err := x.ClientStream.RecvMsg(m); err != nil {
    86  		return nil, err
    87  	}
    88  	return m, nil
    89  }
    90  
    91  // ServerReflectionServer is the server API for ServerReflection service.
    92  // All implementations should embed UnimplementedServerReflectionServer
    93  // for forward compatibility
    94  type ServerReflectionServer interface {
    95  	// The reflection service is structured as a bidirectional stream, ensuring
    96  	// all related requests go to a single server.
    97  	ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error
    98  }
    99  
   100  // UnimplementedServerReflectionServer should be embedded to have forward compatible implementations.
   101  type UnimplementedServerReflectionServer struct {
   102  }
   103  
   104  func (UnimplementedServerReflectionServer) ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error {
   105  	return status.Errorf(codes.Unimplemented, "method ServerReflectionInfo not implemented")
   106  }
   107  
   108  // UnsafeServerReflectionServer may be embedded to opt out of forward compatibility for this service.
   109  // Use of this interface is not recommended, as added methods to ServerReflectionServer will
   110  // result in compilation errors.
   111  type UnsafeServerReflectionServer interface {
   112  	mustEmbedUnimplementedServerReflectionServer()
   113  }
   114  
   115  func RegisterServerReflectionServer(s grpc.ServiceRegistrar, srv ServerReflectionServer) {
   116  	s.RegisterService(&ServerReflection_ServiceDesc, srv)
   117  }
   118  
   119  func _ServerReflection_ServerReflectionInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
   120  	return srv.(ServerReflectionServer).ServerReflectionInfo(&serverReflectionServerReflectionInfoServer{stream})
   121  }
   122  
   123  type ServerReflection_ServerReflectionInfoServer interface {
   124  	Send(*ServerReflectionResponse) error
   125  	Recv() (*ServerReflectionRequest, error)
   126  	grpc.ServerStream
   127  }
   128  
   129  type serverReflectionServerReflectionInfoServer struct {
   130  	grpc.ServerStream
   131  }
   132  
   133  func (x *serverReflectionServerReflectionInfoServer) Send(m *ServerReflectionResponse) error {
   134  	return x.ServerStream.SendMsg(m)
   135  }
   136  
   137  func (x *serverReflectionServerReflectionInfoServer) Recv() (*ServerReflectionRequest, error) {
   138  	m := new(ServerReflectionRequest)
   139  	if err := x.ServerStream.RecvMsg(m); err != nil {
   140  		return nil, err
   141  	}
   142  	return m, nil
   143  }
   144  
   145  // ServerReflection_ServiceDesc is the grpc.ServiceDesc for ServerReflection service.
   146  // It's only intended for direct use with grpc.RegisterService,
   147  // and not to be introspected or modified (even as a copy)
   148  var ServerReflection_ServiceDesc = grpc.ServiceDesc{
   149  	ServiceName: "grpc.reflection.v1alpha.ServerReflection",
   150  	HandlerType: (*ServerReflectionServer)(nil),
   151  	Methods:     []grpc.MethodDesc{},
   152  	Streams: []grpc.StreamDesc{
   153  		{
   154  			StreamName:    "ServerReflectionInfo",
   155  			Handler:       _ServerReflection_ServerReflectionInfo_Handler,
   156  			ServerStreams: true,
   157  			ClientStreams: true,
   158  		},
   159  	},
   160  	Metadata: "grpc/reflection/v1alpha/reflection.proto",
   161  }