[#449] Add tree service for object tagging

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-05-24 09:58:33 +03:00 committed by Alex Vanin
parent 9c74cca9af
commit 99feb1d936
13 changed files with 367 additions and 152 deletions

18
api/cache/system.go vendored
View file

@ -104,6 +104,20 @@ func (o *SystemCache) GetNotificationConfiguration(key string) *data.Notificatio
return result
}
func (o *SystemCache) GetObjectTagging(key string) map[string]string {
entry, err := o.cache.Get(key)
if err != nil {
return nil
}
result, ok := entry.(map[string]string)
if !ok {
return nil
}
return result
}
// PutObject puts an object to cache.
func (o *SystemCache) PutObject(key string, obj *data.ObjectInfo) error {
return o.cache.Set(key, obj)
@ -121,6 +135,10 @@ func (o *SystemCache) PutNotificationConfiguration(key string, obj *data.Notific
return o.cache.Set(key, obj)
}
func (o *SystemCache) PutObjectTagging(key string, tagSet map[string]string) error {
return o.cache.Set(key, tagSet)
}
// Delete deletes an object from cache.
func (o *SystemCache) Delete(key string) bool {
return o.cache.Remove(key)