2024-10-07 17:20:25 +03:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
2024-12-26 10:03:55 +03:00
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.2
2024-10-07 17:20:25 +03:00
// source: api/netmap/grpc/service.proto
package netmap
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
2024-12-26 10:03:55 +03:00
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc . SupportPackageIsVersion9
2024-10-07 17:20:25 +03:00
const (
NetmapService_LocalNodeInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo"
NetmapService_NetworkInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/NetworkInfo"
NetmapService_NetmapSnapshot_FullMethodName = "/neo.fs.v2.netmap.NetmapService/NetmapSnapshot"
)
// NetmapServiceClient is the client API for NetmapService service.
//
// 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.
2024-12-26 10:03:55 +03:00
//
// `NetmapService` provides methods to work with `Network Map` and the
// information required to build it. The resulting `Network Map` is stored in
// sidechain `Netmap` smart contract, while related information can be obtained
// from other FrostFS nodes.
2024-10-07 17:20:25 +03:00
type NetmapServiceClient interface {
// Get NodeInfo structure from the particular node directly.
// Node information can be taken from `Netmap` smart contract. In some cases,
// though, one may want to get recent information directly or to talk to the
// node not yet present in the `Network Map` to find out what API version can
// be used for further communication. This can be also used to check if a node
// is up and running.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// information about the server has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
LocalNodeInfo ( ctx context . Context , in * LocalNodeInfoRequest , opts ... grpc . CallOption ) ( * LocalNodeInfoResponse , error )
// Read recent information about the FrostFS network.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// information about the current network state has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
NetworkInfo ( ctx context . Context , in * NetworkInfoRequest , opts ... grpc . CallOption ) ( * NetworkInfoResponse , error )
// Returns network map snapshot of the current FrostFS epoch.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// information about the current network map has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
NetmapSnapshot ( ctx context . Context , in * NetmapSnapshotRequest , opts ... grpc . CallOption ) ( * NetmapSnapshotResponse , error )
}
type netmapServiceClient struct {
cc grpc . ClientConnInterface
}
func NewNetmapServiceClient ( cc grpc . ClientConnInterface ) NetmapServiceClient {
return & netmapServiceClient { cc }
}
func ( c * netmapServiceClient ) LocalNodeInfo ( ctx context . Context , in * LocalNodeInfoRequest , opts ... grpc . CallOption ) ( * LocalNodeInfoResponse , error ) {
2024-12-26 10:03:55 +03:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2024-10-07 17:20:25 +03:00
out := new ( LocalNodeInfoResponse )
2024-12-26 10:03:55 +03:00
err := c . cc . Invoke ( ctx , NetmapService_LocalNodeInfo_FullMethodName , in , out , cOpts ... )
2024-10-07 17:20:25 +03:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * netmapServiceClient ) NetworkInfo ( ctx context . Context , in * NetworkInfoRequest , opts ... grpc . CallOption ) ( * NetworkInfoResponse , error ) {
2024-12-26 10:03:55 +03:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2024-10-07 17:20:25 +03:00
out := new ( NetworkInfoResponse )
2024-12-26 10:03:55 +03:00
err := c . cc . Invoke ( ctx , NetmapService_NetworkInfo_FullMethodName , in , out , cOpts ... )
2024-10-07 17:20:25 +03:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * netmapServiceClient ) NetmapSnapshot ( ctx context . Context , in * NetmapSnapshotRequest , opts ... grpc . CallOption ) ( * NetmapSnapshotResponse , error ) {
2024-12-26 10:03:55 +03:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2024-10-07 17:20:25 +03:00
out := new ( NetmapSnapshotResponse )
2024-12-26 10:03:55 +03:00
err := c . cc . Invoke ( ctx , NetmapService_NetmapSnapshot_FullMethodName , in , out , cOpts ... )
2024-10-07 17:20:25 +03:00
if err != nil {
return nil , err
}
return out , nil
}
// NetmapServiceServer is the server API for NetmapService service.
// All implementations should embed UnimplementedNetmapServiceServer
2024-12-26 10:03:55 +03:00
// for forward compatibility.
//
// `NetmapService` provides methods to work with `Network Map` and the
// information required to build it. The resulting `Network Map` is stored in
// sidechain `Netmap` smart contract, while related information can be obtained
// from other FrostFS nodes.
2024-10-07 17:20:25 +03:00
type NetmapServiceServer interface {
// Get NodeInfo structure from the particular node directly.
// Node information can be taken from `Netmap` smart contract. In some cases,
// though, one may want to get recent information directly or to talk to the
// node not yet present in the `Network Map` to find out what API version can
// be used for further communication. This can be also used to check if a node
// is up and running.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// information about the server has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
LocalNodeInfo ( context . Context , * LocalNodeInfoRequest ) ( * LocalNodeInfoResponse , error )
// Read recent information about the FrostFS network.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// information about the current network state has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
NetworkInfo ( context . Context , * NetworkInfoRequest ) ( * NetworkInfoResponse , error )
// Returns network map snapshot of the current FrostFS epoch.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// information about the current network map has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
NetmapSnapshot ( context . Context , * NetmapSnapshotRequest ) ( * NetmapSnapshotResponse , error )
}
2024-12-26 10:03:55 +03:00
// UnimplementedNetmapServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedNetmapServiceServer struct { }
2024-10-07 17:20:25 +03:00
func ( UnimplementedNetmapServiceServer ) LocalNodeInfo ( context . Context , * LocalNodeInfoRequest ) ( * LocalNodeInfoResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method LocalNodeInfo not implemented" )
}
func ( UnimplementedNetmapServiceServer ) NetworkInfo ( context . Context , * NetworkInfoRequest ) ( * NetworkInfoResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method NetworkInfo not implemented" )
}
func ( UnimplementedNetmapServiceServer ) NetmapSnapshot ( context . Context , * NetmapSnapshotRequest ) ( * NetmapSnapshotResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method NetmapSnapshot not implemented" )
}
2024-12-26 10:03:55 +03:00
func ( UnimplementedNetmapServiceServer ) testEmbeddedByValue ( ) { }
2024-10-07 17:20:25 +03:00
// UnsafeNetmapServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NetmapServiceServer will
// result in compilation errors.
type UnsafeNetmapServiceServer interface {
mustEmbedUnimplementedNetmapServiceServer ( )
}
func RegisterNetmapServiceServer ( s grpc . ServiceRegistrar , srv NetmapServiceServer ) {
2024-12-26 10:03:55 +03:00
// If the following call pancis, it indicates UnimplementedNetmapServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t , ok := srv . ( interface { testEmbeddedByValue ( ) } ) ; ok {
t . testEmbeddedByValue ( )
}
2024-10-07 17:20:25 +03:00
s . RegisterService ( & NetmapService_ServiceDesc , srv )
}
func _NetmapService_LocalNodeInfo_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( LocalNodeInfoRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NetmapServiceServer ) . LocalNodeInfo ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : NetmapService_LocalNodeInfo_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NetmapServiceServer ) . LocalNodeInfo ( ctx , req . ( * LocalNodeInfoRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NetmapService_NetworkInfo_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( NetworkInfoRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NetmapServiceServer ) . NetworkInfo ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : NetmapService_NetworkInfo_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NetmapServiceServer ) . NetworkInfo ( ctx , req . ( * NetworkInfoRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _NetmapService_NetmapSnapshot_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( NetmapSnapshotRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( NetmapServiceServer ) . NetmapSnapshot ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : NetmapService_NetmapSnapshot_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( NetmapServiceServer ) . NetmapSnapshot ( ctx , req . ( * NetmapSnapshotRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
// NetmapService_ServiceDesc is the grpc.ServiceDesc for NetmapService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NetmapService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "neo.fs.v2.netmap.NetmapService" ,
HandlerType : ( * NetmapServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "LocalNodeInfo" ,
Handler : _NetmapService_LocalNodeInfo_Handler ,
} ,
{
MethodName : "NetworkInfo" ,
Handler : _NetmapService_NetworkInfo_Handler ,
} ,
{
MethodName : "NetmapSnapshot" ,
Handler : _NetmapService_NetmapSnapshot_Handler ,
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "api/netmap/grpc/service.proto" ,
}