forked from TrueCloudLab/frostfs-sdk-go
close #362
This commit is contained in:
commit
47af8441eb
2 changed files with 6 additions and 26 deletions
28
pool/pool.go
28
pool/pool.go
|
@ -2146,11 +2146,6 @@ type ResGetObject struct {
|
||||||
//
|
//
|
||||||
// Main return value MUST NOT be processed on an erroneous return.
|
// Main return value MUST NOT be processed on an erroneous return.
|
||||||
func (p *Pool) GetObject(ctx context.Context, prm PrmObjectGet) (ResGetObject, error) {
|
func (p *Pool) GetObject(ctx context.Context, prm PrmObjectGet) (ResGetObject, error) {
|
||||||
var prmCtx prmContext
|
|
||||||
prmCtx.useDefaultSession()
|
|
||||||
prmCtx.useVerb(session.VerbObjectGet)
|
|
||||||
prmCtx.useAddress(prm.addr)
|
|
||||||
|
|
||||||
p.fillAppropriateKey(&prm.prmCommon)
|
p.fillAppropriateKey(&prm.prmCommon)
|
||||||
|
|
||||||
var cc callContext
|
var cc callContext
|
||||||
|
@ -2159,7 +2154,7 @@ func (p *Pool) GetObject(ctx context.Context, prm PrmObjectGet) (ResGetObject, e
|
||||||
|
|
||||||
var res ResGetObject
|
var res ResGetObject
|
||||||
|
|
||||||
err := p.initCallContext(&cc, prm.prmCommon, prmCtx)
|
err := p.initCallContext(&cc, prm.prmCommon, prmContext{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
@ -2174,11 +2169,6 @@ func (p *Pool) GetObject(ctx context.Context, prm PrmObjectGet) (ResGetObject, e
|
||||||
//
|
//
|
||||||
// Main return value MUST NOT be processed on an erroneous return.
|
// Main return value MUST NOT be processed on an erroneous return.
|
||||||
func (p *Pool) HeadObject(ctx context.Context, prm PrmObjectHead) (object.Object, error) {
|
func (p *Pool) HeadObject(ctx context.Context, prm PrmObjectHead) (object.Object, error) {
|
||||||
var prmCtx prmContext
|
|
||||||
prmCtx.useDefaultSession()
|
|
||||||
prmCtx.useVerb(session.VerbObjectHead)
|
|
||||||
prmCtx.useAddress(prm.addr)
|
|
||||||
|
|
||||||
p.fillAppropriateKey(&prm.prmCommon)
|
p.fillAppropriateKey(&prm.prmCommon)
|
||||||
|
|
||||||
var cc callContext
|
var cc callContext
|
||||||
|
@ -2188,7 +2178,7 @@ func (p *Pool) HeadObject(ctx context.Context, prm PrmObjectHead) (object.Object
|
||||||
|
|
||||||
var obj object.Object
|
var obj object.Object
|
||||||
|
|
||||||
err := p.initCallContext(&cc, prm.prmCommon, prmCtx)
|
err := p.initCallContext(&cc, prm.prmCommon, prmContext{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return obj, err
|
return obj, err
|
||||||
}
|
}
|
||||||
|
@ -2229,11 +2219,6 @@ func (x *ResObjectRange) Close() error {
|
||||||
//
|
//
|
||||||
// Main return value MUST NOT be processed on an erroneous return.
|
// Main return value MUST NOT be processed on an erroneous return.
|
||||||
func (p *Pool) ObjectRange(ctx context.Context, prm PrmObjectRange) (ResObjectRange, error) {
|
func (p *Pool) ObjectRange(ctx context.Context, prm PrmObjectRange) (ResObjectRange, error) {
|
||||||
var prmCtx prmContext
|
|
||||||
prmCtx.useDefaultSession()
|
|
||||||
prmCtx.useVerb(session.VerbObjectRange)
|
|
||||||
prmCtx.useAddress(prm.addr)
|
|
||||||
|
|
||||||
p.fillAppropriateKey(&prm.prmCommon)
|
p.fillAppropriateKey(&prm.prmCommon)
|
||||||
|
|
||||||
var cc callContext
|
var cc callContext
|
||||||
|
@ -2242,7 +2227,7 @@ func (p *Pool) ObjectRange(ctx context.Context, prm PrmObjectRange) (ResObjectRa
|
||||||
|
|
||||||
var res ResObjectRange
|
var res ResObjectRange
|
||||||
|
|
||||||
err := p.initCallContext(&cc, prm.prmCommon, prmCtx)
|
err := p.initCallContext(&cc, prm.prmCommon, prmContext{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
@ -2296,11 +2281,6 @@ func (x *ResObjectSearch) Close() {
|
||||||
//
|
//
|
||||||
// Main return value MUST NOT be processed on an erroneous return.
|
// Main return value MUST NOT be processed on an erroneous return.
|
||||||
func (p *Pool) SearchObjects(ctx context.Context, prm PrmObjectSearch) (ResObjectSearch, error) {
|
func (p *Pool) SearchObjects(ctx context.Context, prm PrmObjectSearch) (ResObjectSearch, error) {
|
||||||
var prmCtx prmContext
|
|
||||||
prmCtx.useDefaultSession()
|
|
||||||
prmCtx.useVerb(session.VerbObjectSearch)
|
|
||||||
prmCtx.useContainer(prm.cnrID)
|
|
||||||
|
|
||||||
p.fillAppropriateKey(&prm.prmCommon)
|
p.fillAppropriateKey(&prm.prmCommon)
|
||||||
|
|
||||||
var cc callContext
|
var cc callContext
|
||||||
|
@ -2310,7 +2290,7 @@ func (p *Pool) SearchObjects(ctx context.Context, prm PrmObjectSearch) (ResObjec
|
||||||
|
|
||||||
var res ResObjectSearch
|
var res ResObjectSearch
|
||||||
|
|
||||||
err := p.initCallContext(&cc, prm.prmCommon, prmCtx)
|
err := p.initCallContext(&cc, prm.prmCommon, prmContext{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -413,12 +413,12 @@ func TestSessionCacheWithKey(t *testing.T) {
|
||||||
st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key))
|
st, _ := pool.cache.Get(formCacheKey(cp.address(), pool.key))
|
||||||
require.True(t, st.AssertAuthKey(&expectedAuthKey))
|
require.True(t, st.AssertAuthKey(&expectedAuthKey))
|
||||||
|
|
||||||
var prm PrmObjectGet
|
var prm PrmObjectDelete
|
||||||
prm.SetAddress(oid.Address{})
|
prm.SetAddress(oid.Address{})
|
||||||
anonKey := newPrivateKey(t)
|
anonKey := newPrivateKey(t)
|
||||||
prm.UseKey(anonKey)
|
prm.UseKey(anonKey)
|
||||||
|
|
||||||
_, err = pool.GetObject(ctx, prm)
|
err = pool.DeleteObject(ctx, prm)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
st, _ = pool.cache.Get(formCacheKey(cp.address(), anonKey))
|
st, _ = pool.cache.Get(formCacheKey(cp.address(), anonKey))
|
||||||
require.True(t, st.AssertAuthKey(&expectedAuthKey))
|
require.True(t, st.AssertAuthKey(&expectedAuthKey))
|
||||||
|
|
Loading…
Reference in a new issue