[#57] downloader, uploader: Replace deprecated

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2021-06-04 15:55:56 +03:00
parent 124a30eec7
commit 2f8ab7cb8d
2 changed files with 10 additions and 9 deletions

View file

@ -13,9 +13,9 @@ import (
"time"
"github.com/nspcc-dev/neofs-api-go/pkg/client"
"github.com/nspcc-dev/neofs-api-go/pkg/container"
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
"github.com/nspcc-dev/neofs-api-go/pkg/object"
"github.com/nspcc-dev/neofs-api-go/pkg/token"
"github.com/nspcc-dev/neofs-api-go/pkg/session"
"github.com/nspcc-dev/neofs-http-gw/tokens"
"github.com/nspcc-dev/neofs-sdk-go/pkg/pool"
"github.com/valyala/fasthttp"
@ -73,7 +73,7 @@ func isValidValue(s string) bool {
}
func (r *request) receiveFile(clnt client.Client,
sessionToken *token.SessionToken,
sessionToken *session.Token,
objectAddress *object.Address) {
var (
err error
@ -195,7 +195,7 @@ func (d *Downloader) DownloadByAddress(c *fasthttp.RequestCtx) {
val = strings.Join([]string{cid, oid}, "/")
log = d.log.With(zap.String("cid", cid), zap.String("oid", oid))
conn client.Client
tkn *token.SessionToken
tkn *session.Token
)
if err = address.Parse(val); err != nil {
log.Error("wrong object address", zap.Error(err))
@ -222,9 +222,9 @@ func (d *Downloader) DownloadByAttribute(c *fasthttp.RequestCtx) {
log = d.log.With(zap.String("cid", scid), zap.String("attr_key", key), zap.String("attr_val", val))
ids []*object.ID
conn client.Client
tkn *token.SessionToken
tkn *session.Token
)
cid := container.NewID()
cid := cid.New()
if err = cid.Parse(scid); err != nil {
log.Error("wrong container id", zap.Error(err))
c.Error("wrong container id", fasthttp.StatusBadRequest)

View file

@ -8,9 +8,10 @@ import (
"time"
"github.com/nspcc-dev/neofs-api-go/pkg/client"
"github.com/nspcc-dev/neofs-api-go/pkg/container"
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
"github.com/nspcc-dev/neofs-api-go/pkg/object"
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
"github.com/nspcc-dev/neofs-api-go/pkg/session"
"github.com/nspcc-dev/neofs-api-go/pkg/token"
"github.com/nspcc-dev/neofs-http-gw/tokens"
"github.com/nspcc-dev/neofs-sdk-go/pkg/pool"
@ -43,9 +44,9 @@ func (u *Uploader) Upload(c *fasthttp.RequestCtx) {
file MultipartFile
obj *object.ID
conn client.Client
tkn *token.SessionToken
tkn *session.Token
addr = object.NewAddress()
cid = container.NewID()
cid = cid.New()
scid, _ = c.UserValue("cid").(string)
log = u.log.With(zap.String("cid", scid))
bodyStream = c.RequestBodyStream()