[#169] Add --ttl argument in CLI

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-11-16 11:25:42 +03:00 committed by Alex Vanin
parent ea41dec23f
commit e47c866d6a
5 changed files with 39 additions and 15 deletions

View file

@ -6,6 +6,7 @@ import (
"math"
"github.com/nspcc-dev/neofs-api-go/pkg/accounting"
"github.com/nspcc-dev/neofs-api-go/pkg/client"
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
"github.com/spf13/cobra"
)
@ -41,14 +42,14 @@ var accountingBalanceCmd = &cobra.Command{
switch balanceOwner {
case "":
response, err = cli.GetSelfBalance(ctx)
response, err = cli.GetSelfBalance(ctx, client.WithTTL(getTTL()))
default:
oid, err = ownerFromString(balanceOwner)
if err != nil {
return err
}
response, err = cli.GetBalance(ctx, oid)
response, err = cli.GetBalance(ctx, oid, client.WithTTL(getTTL()))
}
if err != nil {