frostfs-api-go/rpc/accounting.go
Evgenii Stratonikov 1351b6656d Move to frostfs-api
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2022-12-12 17:40:48 +03:00

29 lines
724 B
Go

package rpc
import (
"github.com/TrueCloudLab/frostfs-api-go/v2/accounting"
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client"
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common"
)
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
}