[#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

@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"github.com/nspcc-dev/neofs-api-go/pkg/client"
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
"github.com/spf13/cobra"
)
@ -46,7 +47,7 @@ var getEpochCmd = &cobra.Command{
return err
}
e, err := cli.Epoch(context.Background())
e, err := cli.Epoch(context.Background(), client.WithTTL(getTTL()))
if err != nil {
return fmt.Errorf("rpc error: %w", err)
}
@ -67,7 +68,7 @@ var localNodeInfoCmd = &cobra.Command{
return err
}
nodeInfo, err := cli.EndpointInfo(context.Background())
nodeInfo, err := cli.EndpointInfo(context.Background(), client.WithTTL(getTTL()))
if err != nil {
return fmt.Errorf("rpc error: %w", err)
}