2021-03-12 12:57:23 +00:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
2023-03-07 10:38:56 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common"
|
2021-03-12 12:57:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const serviceAccounting = serviceNamePrefix + "accounting.AccountingService"
|
|
|
|
|
|
|
|
const (
|
|
|
|
rpcAccountingBalance = "Balance"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Balance executes AccountingService.Balance RPC.
|
|
|
|
func Balance(
|
|
|
|
cli *client.Client,
|
|
|
|
req *accounting.BalanceRequest,
|
|
|
|
opts ...client.CallOption,
|
|
|
|
) (*accounting.BalanceResponse, error) {
|
|
|
|
resp := new(accounting.BalanceResponse)
|
|
|
|
|
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAccounting, rpcAccountingBalance), req, resp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return resp, nil
|
|
|
|
}
|