forked from TrueCloudLab/frostfs-s3-gw
[#451] Handle lock objects using tree service
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
bc000f1bc4
commit
dd534e8738
23 changed files with 488 additions and 520 deletions
20
api/cache/system.go
vendored
20
api/cache/system.go
vendored
|
@ -56,6 +56,21 @@ func (o *SystemCache) GetObject(key string) *data.ObjectInfo {
|
|||
return result
|
||||
}
|
||||
|
||||
// GetLockInfo returns a cached object.
|
||||
func (o *SystemCache) GetLockInfo(key string) *data.LockInfo {
|
||||
entry, err := o.cache.Get(key)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
result, ok := entry.(*data.LockInfo)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func (o *SystemCache) GetCORS(key string) *data.CORSConfiguration {
|
||||
entry, err := o.cache.Get(key)
|
||||
if err != nil {
|
||||
|
@ -124,6 +139,11 @@ func (o *SystemCache) PutObject(key string, obj *data.ObjectInfo) error {
|
|||
return o.cache.Set(key, obj)
|
||||
}
|
||||
|
||||
// PutLockInfo puts an object to cache.
|
||||
func (o *SystemCache) PutLockInfo(key string, lockInfo *data.LockInfo) error {
|
||||
return o.cache.Set(key, lockInfo)
|
||||
}
|
||||
|
||||
func (o *SystemCache) PutCORS(key string, obj *data.CORSConfiguration) error {
|
||||
return o.cache.Set(key, obj)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue