forked from TrueCloudLab/frostfs-node
[#1454] Upgrade NeoFS SDK Go module with new IDs
Core changes: * avoid package-colliding variable naming * avoid using pointers to IDs where unnecessary * avoid using `idSDK` import alias pattern * use `EncodeToString` for protocol string calculation and `String` for printing Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
cc6209e8a0
commit
1c30414a6c
218 changed files with 2095 additions and 2521 deletions
|
@ -9,7 +9,6 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/writecache"
|
||||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
@ -57,8 +56,9 @@ func init() {
|
|||
}
|
||||
|
||||
func objectInspectCmd(cmd *cobra.Command, _ []string) {
|
||||
addr := addressSDK.NewAddress()
|
||||
err := addr.Parse(vAddress)
|
||||
var addr oid.Address
|
||||
|
||||
err := addr.DecodeString(vAddress)
|
||||
common.ExitOnErr(cmd, common.Errf("invalid address argument: %w", err))
|
||||
|
||||
if vOut == "" && !vHeader {
|
||||
|
@ -72,7 +72,7 @@ func objectInspectCmd(cmd *cobra.Command, _ []string) {
|
|||
|
||||
defer db.Close()
|
||||
|
||||
data, err := writecache.Get(db, []byte(addr.String()))
|
||||
data, err := writecache.Get(db, []byte(vAddress))
|
||||
common.ExitOnErr(cmd, common.Errf("could not fetch object: %w", err))
|
||||
printObjectInfo(cmd, data)
|
||||
return
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package cmdlist
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
common "github.com/nspcc-dev/neofs-node/cmd/neofs-lens/internal"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobovnicza"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/writecache"
|
||||
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
@ -40,8 +41,8 @@ var Command = &cobra.Command{
|
|||
// other targets can be supported
|
||||
w := cmd.OutOrStderr()
|
||||
|
||||
wAddr := func(addr *addressSDK.Address) error {
|
||||
_, err := io.WriteString(w, addr.String()+"\n")
|
||||
wAddr := func(addr oid.Address) error {
|
||||
_, err := io.WriteString(w, fmt.Sprintf("%s\n", addr))
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue