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