forked from TrueCloudLab/frostfs-s3-gw
[#458] *: Refactor working with NeoFS identities
Pull latest changes from NeoFS SDK Go library. Decrease redundant and unsafe usage of ID pointers. Use `EncodeToString` method in order to calculate protocol strings. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3f0dbcc995
commit
087d500c5f
34 changed files with 259 additions and 280 deletions
10
api/cache/accessbox.go
vendored
10
api/cache/accessbox.go
vendored
|
@ -5,7 +5,7 @@ import (
|
|||
|
||||
"github.com/bluele/gcache"
|
||||
"github.com/nspcc-dev/neofs-s3-gw/creds/accessbox"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
)
|
||||
|
||||
type (
|
||||
|
@ -41,8 +41,8 @@ func NewAccessBoxCache(config *Config) *AccessBoxCache {
|
|||
}
|
||||
|
||||
// Get returns a cached object.
|
||||
func (o *AccessBoxCache) Get(address *address.Address) *accessbox.Box {
|
||||
entry, err := o.cache.Get(address.String())
|
||||
func (o *AccessBoxCache) Get(address oid.Address) *accessbox.Box {
|
||||
entry, err := o.cache.Get(address.EncodeToString())
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
@ -56,6 +56,6 @@ func (o *AccessBoxCache) Get(address *address.Address) *accessbox.Box {
|
|||
}
|
||||
|
||||
// Put stores an object to cache.
|
||||
func (o *AccessBoxCache) Put(address *address.Address, box *accessbox.Box) error {
|
||||
return o.cache.Set(address.String(), box)
|
||||
func (o *AccessBoxCache) Put(address oid.Address, box *accessbox.Box) error {
|
||||
return o.cache.Set(address.EncodeToString(), box)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue