forked from TrueCloudLab/frostfs-node
[#1377] oid, cid: Upgrade SDK package
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f65898a354
commit
f15e6e888f
118 changed files with 1455 additions and 886 deletions
|
@ -1,6 +1,7 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
@ -29,8 +30,11 @@ func AsContainerSource(w *Client) core.Source {
|
|||
// Get marshals container ID, and passes it to Wrapper's Get method.
|
||||
//
|
||||
// Returns error if cid is nil.
|
||||
func Get(c *Client, cid *cid.ID) (*container.Container, error) {
|
||||
return c.Get(cid.ToV2().GetValue())
|
||||
func Get(c *Client, cnr *cid.ID) (*container.Container, error) {
|
||||
binCnr := make([]byte, sha256.Size)
|
||||
cnr.Encode(binCnr)
|
||||
|
||||
return c.Get(binCnr)
|
||||
}
|
||||
|
||||
// Get reads the container from NeoFS system by binary identifier
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue