...

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

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

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

View as plain text