...

Source file src/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go

Documentation: google.golang.org/grpc/reflection/grpc_reflection_v1alpha

     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.62.0 or later.
    37  const _ = grpc.SupportPackageIsVersion8
    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  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
    62  	stream, err := c.cc.NewStream(ctx, &ServerReflection_ServiceDesc.Streams[0], ServerReflection_ServerReflectionInfo_FullMethodName, cOpts...)
    63  	if err != nil {
    64  		return nil, err
    65  	}
    66  	x := &serverReflectionServerReflectionInfoClient{ClientStream: stream}
    67  	return x, nil
    68  }
    69  
    70  type ServerReflection_ServerReflectionInfoClient interface {
    71  	Send(*ServerReflectionRequest) error
    72  	Recv() (*ServerReflectionResponse, error)
    73  	grpc.ClientStream
    74  }
    75  
    76  type serverReflectionServerReflectionInfoClient struct {
    77  	grpc.ClientStream
    78  }
    79  
    80  func (x *serverReflectionServerReflectionInfoClient) Send(m *ServerReflectionRequest) error {
    81  	return x.ClientStream.SendMsg(m)
    82  }
    83  
    84  func (x *serverReflectionServerReflectionInfoClient) Recv() (*ServerReflectionResponse, error) {
    85  	m := new(ServerReflectionResponse)
    86  	if err := x.ClientStream.RecvMsg(m); err != nil {
    87  		return nil, err
    88  	}
    89  	return m, nil
    90  }
    91  
    92  // ServerReflectionServer is the server API for ServerReflection service.
    93  // All implementations should embed UnimplementedServerReflectionServer
    94  // for forward compatibility
    95  type ServerReflectionServer interface {
    96  	// The reflection service is structured as a bidirectional stream, ensuring
    97  	// all related requests go to a single server.
    98  	ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error
    99  }
   100  
   101  // UnimplementedServerReflectionServer should be embedded to have forward compatible implementations.
   102  type UnimplementedServerReflectionServer struct {
   103  }
   104  
   105  func (UnimplementedServerReflectionServer) ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error {
   106  	return status.Errorf(codes.Unimplemented, "method ServerReflectionInfo not implemented")
   107  }
   108  
   109  // UnsafeServerReflectionServer may be embedded to opt out of forward compatibility for this service.
   110  // Use of this interface is not recommended, as added methods to ServerReflectionServer will
   111  // result in compilation errors.
   112  type UnsafeServerReflectionServer interface {
   113  	mustEmbedUnimplementedServerReflectionServer()
   114  }
   115  
   116  func RegisterServerReflectionServer(s grpc.ServiceRegistrar, srv ServerReflectionServer) {
   117  	s.RegisterService(&ServerReflection_ServiceDesc, srv)
   118  }
   119  
   120  func _ServerReflection_ServerReflectionInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
   121  	return srv.(ServerReflectionServer).ServerReflectionInfo(&serverReflectionServerReflectionInfoServer{ServerStream: stream})
   122  }
   123  
   124  type ServerReflection_ServerReflectionInfoServer interface {
   125  	Send(*ServerReflectionResponse) error
   126  	Recv() (*ServerReflectionRequest, error)
   127  	grpc.ServerStream
   128  }
   129  
   130  type serverReflectionServerReflectionInfoServer struct {
   131  	grpc.ServerStream
   132  }
   133  
   134  func (x *serverReflectionServerReflectionInfoServer) Send(m *ServerReflectionResponse) error {
   135  	return x.ServerStream.SendMsg(m)
   136  }
   137  
   138  func (x *serverReflectionServerReflectionInfoServer) Recv() (*ServerReflectionRequest, error) {
   139  	m := new(ServerReflectionRequest)
   140  	if err := x.ServerStream.RecvMsg(m); err != nil {
   141  		return nil, err
   142  	}
   143  	return m, nil
   144  }
   145  
   146  // ServerReflection_ServiceDesc is the grpc.ServiceDesc for ServerReflection service.
   147  // It's only intended for direct use with grpc.RegisterService,
   148  // and not to be introspected or modified (even as a copy)
   149  var ServerReflection_ServiceDesc = grpc.ServiceDesc{
   150  	ServiceName: "grpc.reflection.v1alpha.ServerReflection",
   151  	HandlerType: (*ServerReflectionServer)(nil),
   152  	Methods:     []grpc.MethodDesc{},
   153  	Streams: []grpc.StreamDesc{
   154  		{
   155  			StreamName:    "ServerReflectionInfo",
   156  			Handler:       _ServerReflection_ServerReflectionInfo_Handler,
   157  			ServerStreams: true,
   158  			ClientStreams: true,
   159  		},
   160  	},
   161  	Metadata: "grpc/reflection/v1alpha/reflection.proto",
   162  }
   163  

View as plain text