github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/netmap/grpc/service_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             v3.21.9
     5  // source: netmap/grpc/service.proto
     6  
     7  package netmap
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the grpc package it is being compiled against.
    18  // Requires gRPC-Go v1.32.0 or later.
    19  const _ = grpc.SupportPackageIsVersion7
    20  
    21  // NetmapServiceClient is the client API for NetmapService service.
    22  //
    23  // 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.
    24  type NetmapServiceClient interface {
    25  	// Get NodeInfo structure from the particular node directly.
    26  	// Node information can be taken from `Netmap` smart contract. In some cases, though,
    27  	// one may want to get recent information directly or to talk to the node not yet
    28  	// present in the `Network Map` to find out what API version can be used for
    29  	// further communication. This can be also used to check if a node is up and running.
    30  	//
    31  	// Statuses:
    32  	// - **OK** (0, SECTION_SUCCESS):
    33  	// information about the server has been successfully read;
    34  	// - Common failures (SECTION_FAILURE_COMMON).
    35  	LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error)
    36  	// Read recent information about the NeoFS network.
    37  	//
    38  	// Statuses:
    39  	// - **OK** (0, SECTION_SUCCESS):
    40  	// information about the current network state has been successfully read;
    41  	// - Common failures (SECTION_FAILURE_COMMON).
    42  	NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error)
    43  	// Returns network map snapshot of the current NeoFS epoch.
    44  	//
    45  	// Statuses:
    46  	// - **OK** (0, SECTION_SUCCESS):
    47  	// information about the current network map has been successfully read;
    48  	// - Common failures (SECTION_FAILURE_COMMON).
    49  	NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error)
    50  }
    51  
    52  type netmapServiceClient struct {
    53  	cc grpc.ClientConnInterface
    54  }
    55  
    56  func NewNetmapServiceClient(cc grpc.ClientConnInterface) NetmapServiceClient {
    57  	return &netmapServiceClient{cc}
    58  }
    59  
    60  func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) {
    61  	out := new(LocalNodeInfoResponse)
    62  	err := c.cc.Invoke(ctx, "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo", in, out, opts...)
    63  	if err != nil {
    64  		return nil, err
    65  	}
    66  	return out, nil
    67  }
    68  
    69  func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) {
    70  	out := new(NetworkInfoResponse)
    71  	err := c.cc.Invoke(ctx, "/neo.fs.v2.netmap.NetmapService/NetworkInfo", in, out, opts...)
    72  	if err != nil {
    73  		return nil, err
    74  	}
    75  	return out, nil
    76  }
    77  
    78  func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) {
    79  	out := new(NetmapSnapshotResponse)
    80  	err := c.cc.Invoke(ctx, "/neo.fs.v2.netmap.NetmapService/NetmapSnapshot", in, out, opts...)
    81  	if err != nil {
    82  		return nil, err
    83  	}
    84  	return out, nil
    85  }
    86  
    87  // NetmapServiceServer is the server API for NetmapService service.
    88  // All implementations should embed UnimplementedNetmapServiceServer
    89  // for forward compatibility
    90  type NetmapServiceServer interface {
    91  	// Get NodeInfo structure from the particular node directly.
    92  	// Node information can be taken from `Netmap` smart contract. In some cases, though,
    93  	// one may want to get recent information directly or to talk to the node not yet
    94  	// present in the `Network Map` to find out what API version can be used for
    95  	// further communication. This can be also used to check if a node is up and running.
    96  	//
    97  	// Statuses:
    98  	// - **OK** (0, SECTION_SUCCESS):
    99  	// information about the server has been successfully read;
   100  	// - Common failures (SECTION_FAILURE_COMMON).
   101  	LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error)
   102  	// Read recent information about the NeoFS network.
   103  	//
   104  	// Statuses:
   105  	// - **OK** (0, SECTION_SUCCESS):
   106  	// information about the current network state has been successfully read;
   107  	// - Common failures (SECTION_FAILURE_COMMON).
   108  	NetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error)
   109  	// Returns network map snapshot of the current NeoFS epoch.
   110  	//
   111  	// Statuses:
   112  	// - **OK** (0, SECTION_SUCCESS):
   113  	// information about the current network map has been successfully read;
   114  	// - Common failures (SECTION_FAILURE_COMMON).
   115  	NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error)
   116  }
   117  
   118  // UnimplementedNetmapServiceServer should be embedded to have forward compatible implementations.
   119  type UnimplementedNetmapServiceServer struct {
   120  }
   121  
   122  func (UnimplementedNetmapServiceServer) LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) {
   123  	return nil, status.Errorf(codes.Unimplemented, "method LocalNodeInfo not implemented")
   124  }
   125  func (UnimplementedNetmapServiceServer) NetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) {
   126  	return nil, status.Errorf(codes.Unimplemented, "method NetworkInfo not implemented")
   127  }
   128  func (UnimplementedNetmapServiceServer) NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) {
   129  	return nil, status.Errorf(codes.Unimplemented, "method NetmapSnapshot not implemented")
   130  }
   131  
   132  // UnsafeNetmapServiceServer may be embedded to opt out of forward compatibility for this service.
   133  // Use of this interface is not recommended, as added methods to NetmapServiceServer will
   134  // result in compilation errors.
   135  type UnsafeNetmapServiceServer interface {
   136  	mustEmbedUnimplementedNetmapServiceServer()
   137  }
   138  
   139  func RegisterNetmapServiceServer(s grpc.ServiceRegistrar, srv NetmapServiceServer) {
   140  	s.RegisterService(&NetmapService_ServiceDesc, srv)
   141  }
   142  
   143  func _NetmapService_LocalNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   144  	in := new(LocalNodeInfoRequest)
   145  	if err := dec(in); err != nil {
   146  		return nil, err
   147  	}
   148  	if interceptor == nil {
   149  		return srv.(NetmapServiceServer).LocalNodeInfo(ctx, in)
   150  	}
   151  	info := &grpc.UnaryServerInfo{
   152  		Server:     srv,
   153  		FullMethod: "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo",
   154  	}
   155  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   156  		return srv.(NetmapServiceServer).LocalNodeInfo(ctx, req.(*LocalNodeInfoRequest))
   157  	}
   158  	return interceptor(ctx, in, info, handler)
   159  }
   160  
   161  func _NetmapService_NetworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   162  	in := new(NetworkInfoRequest)
   163  	if err := dec(in); err != nil {
   164  		return nil, err
   165  	}
   166  	if interceptor == nil {
   167  		return srv.(NetmapServiceServer).NetworkInfo(ctx, in)
   168  	}
   169  	info := &grpc.UnaryServerInfo{
   170  		Server:     srv,
   171  		FullMethod: "/neo.fs.v2.netmap.NetmapService/NetworkInfo",
   172  	}
   173  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   174  		return srv.(NetmapServiceServer).NetworkInfo(ctx, req.(*NetworkInfoRequest))
   175  	}
   176  	return interceptor(ctx, in, info, handler)
   177  }
   178  
   179  func _NetmapService_NetmapSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   180  	in := new(NetmapSnapshotRequest)
   181  	if err := dec(in); err != nil {
   182  		return nil, err
   183  	}
   184  	if interceptor == nil {
   185  		return srv.(NetmapServiceServer).NetmapSnapshot(ctx, in)
   186  	}
   187  	info := &grpc.UnaryServerInfo{
   188  		Server:     srv,
   189  		FullMethod: "/neo.fs.v2.netmap.NetmapService/NetmapSnapshot",
   190  	}
   191  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   192  		return srv.(NetmapServiceServer).NetmapSnapshot(ctx, req.(*NetmapSnapshotRequest))
   193  	}
   194  	return interceptor(ctx, in, info, handler)
   195  }
   196  
   197  // NetmapService_ServiceDesc is the grpc.ServiceDesc for NetmapService service.
   198  // It's only intended for direct use with grpc.RegisterService,
   199  // and not to be introspected or modified (even as a copy)
   200  var NetmapService_ServiceDesc = grpc.ServiceDesc{
   201  	ServiceName: "neo.fs.v2.netmap.NetmapService",
   202  	HandlerType: (*NetmapServiceServer)(nil),
   203  	Methods: []grpc.MethodDesc{
   204  		{
   205  			MethodName: "LocalNodeInfo",
   206  			Handler:    _NetmapService_LocalNodeInfo_Handler,
   207  		},
   208  		{
   209  			MethodName: "NetworkInfo",
   210  			Handler:    _NetmapService_NetworkInfo_Handler,
   211  		},
   212  		{
   213  			MethodName: "NetmapSnapshot",
   214  			Handler:    _NetmapService_NetmapSnapshot_Handler,
   215  		},
   216  	},
   217  	Streams:  []grpc.StreamDesc{},
   218  	Metadata: "netmap/grpc/service.proto",
   219  }