github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/rpc/accounting.go (about) 1 package rpc 2 3 import ( 4 "github.com/TrueCloudLab/frostfs-api-go/v2/accounting" 5 "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client" 6 "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" 7 ) 8 9 const serviceAccounting = serviceNamePrefix + "accounting.AccountingService" 10 11 const ( 12 rpcAccountingBalance = "Balance" 13 ) 14 15 // Balance executes AccountingService.Balance RPC. 16 func Balance( 17 cli *client.Client, 18 req *accounting.BalanceRequest, 19 opts ...client.CallOption, 20 ) (*accounting.BalanceResponse, error) { 21 resp := new(accounting.BalanceResponse) 22 23 err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAccounting, rpcAccountingBalance), req, resp, opts...) 24 if err != nil { 25 return nil, err 26 } 27 28 return resp, nil 29 }