forked from TrueCloudLab/frostfs-s3-gw
[#340] Add notification configuration handlers
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
4cbce87eac
commit
4454821285
9 changed files with 320 additions and 10 deletions
18
api/cache/system.go
vendored
18
api/cache/system.go
vendored
|
@ -61,6 +61,20 @@ func (o *SystemCache) GetCORS(key string) *data.CORSConfiguration {
|
|||
return result
|
||||
}
|
||||
|
||||
func (o *SystemCache) GetNotificationConfiguration(key string) *data.NotificationConfiguration {
|
||||
entry, err := o.cache.Get(key)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
result, ok := entry.(*data.NotificationConfiguration)
|
||||
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)
|
||||
|
@ -70,6 +84,10 @@ func (o *SystemCache) PutCORS(key string, obj *data.CORSConfiguration) error {
|
|||
return o.cache.Set(key, obj)
|
||||
}
|
||||
|
||||
func (o *SystemCache) PutNotificationConfiguration(key string, obj *data.NotificationConfiguration) error {
|
||||
return o.cache.Set(key, obj)
|
||||
}
|
||||
|
||||
// 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