forked from TrueCloudLab/frostfs-s3-gw
[#449] Add tree service for object tagging
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
9c74cca9af
commit
99feb1d936
13 changed files with 367 additions and 152 deletions
18
api/cache/system.go
vendored
18
api/cache/system.go
vendored
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue