frostfs-api-go/v2/rpc/accounting.go

30 lines
703 B
Go
Raw Normal View History

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