github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/accounting/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: accounting/grpc/service.proto 6 7 package accounting 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 // AccountingServiceClient is the client API for AccountingService 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 AccountingServiceClient interface { 25 // Returns the amount of funds in GAS token for the requested NeoFS account. 26 // 27 // Statuses: 28 // - **OK** (0, SECTION_SUCCESS): 29 // balance has been successfully read; 30 // - Common failures (SECTION_FAILURE_COMMON). 31 Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) 32 } 33 34 type accountingServiceClient struct { 35 cc grpc.ClientConnInterface 36 } 37 38 func NewAccountingServiceClient(cc grpc.ClientConnInterface) AccountingServiceClient { 39 return &accountingServiceClient{cc} 40 } 41 42 func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) { 43 out := new(BalanceResponse) 44 err := c.cc.Invoke(ctx, "/neo.fs.v2.accounting.AccountingService/Balance", in, out, opts...) 45 if err != nil { 46 return nil, err 47 } 48 return out, nil 49 } 50 51 // AccountingServiceServer is the server API for AccountingService service. 52 // All implementations should embed UnimplementedAccountingServiceServer 53 // for forward compatibility 54 type AccountingServiceServer interface { 55 // Returns the amount of funds in GAS token for the requested NeoFS account. 56 // 57 // Statuses: 58 // - **OK** (0, SECTION_SUCCESS): 59 // balance has been successfully read; 60 // - Common failures (SECTION_FAILURE_COMMON). 61 Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) 62 } 63 64 // UnimplementedAccountingServiceServer should be embedded to have forward compatible implementations. 65 type UnimplementedAccountingServiceServer struct { 66 } 67 68 func (UnimplementedAccountingServiceServer) Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) { 69 return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") 70 } 71 72 // UnsafeAccountingServiceServer may be embedded to opt out of forward compatibility for this service. 73 // Use of this interface is not recommended, as added methods to AccountingServiceServer will 74 // result in compilation errors. 75 type UnsafeAccountingServiceServer interface { 76 mustEmbedUnimplementedAccountingServiceServer() 77 } 78 79 func RegisterAccountingServiceServer(s grpc.ServiceRegistrar, srv AccountingServiceServer) { 80 s.RegisterService(&AccountingService_ServiceDesc, srv) 81 } 82 83 func _AccountingService_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 84 in := new(BalanceRequest) 85 if err := dec(in); err != nil { 86 return nil, err 87 } 88 if interceptor == nil { 89 return srv.(AccountingServiceServer).Balance(ctx, in) 90 } 91 info := &grpc.UnaryServerInfo{ 92 Server: srv, 93 FullMethod: "/neo.fs.v2.accounting.AccountingService/Balance", 94 } 95 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 96 return srv.(AccountingServiceServer).Balance(ctx, req.(*BalanceRequest)) 97 } 98 return interceptor(ctx, in, info, handler) 99 } 100 101 // AccountingService_ServiceDesc is the grpc.ServiceDesc for AccountingService service. 102 // It's only intended for direct use with grpc.RegisterService, 103 // and not to be introspected or modified (even as a copy) 104 var AccountingService_ServiceDesc = grpc.ServiceDesc{ 105 ServiceName: "neo.fs.v2.accounting.AccountingService", 106 HandlerType: (*AccountingServiceServer)(nil), 107 Methods: []grpc.MethodDesc{ 108 { 109 MethodName: "Balance", 110 Handler: _AccountingService_Balance_Handler, 111 }, 112 }, 113 Streams: []grpc.StreamDesc{}, 114 Metadata: "accounting/grpc/service.proto", 115 }