From d4ae8e5b7143a25a28432eaa3efeb27e472ad7de Mon Sep 17 00:00:00 2001 From: DanB Date: Thu, 8 Mar 2018 20:28:34 +0100 Subject: [PATCH] CacheSv1.Clear API --- apier/v1/caches.go | 6 ++++++ engine/caches.go | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/apier/v1/caches.go b/apier/v1/caches.go index f872f7a36..1fd136581 100644 --- a/apier/v1/caches.go +++ b/apier/v1/caches.go @@ -56,3 +56,9 @@ func (chSv1 *CacheSv1) RemoveItem(args *engine.ArgsGetCacheItem, reply *string) error { return chSv1.cacheS.V1RemoveItem(args, reply) } + +// Clear will clear partitions in the cache (all for nil, none for empty slice) +func (chSv1 *CacheSv1) Clear(cacheIDs []string, + reply *string) error { + return chSv1.cacheS.V1Clear(cacheIDs, reply) +} diff --git a/engine/caches.go b/engine/caches.go index 8d4032a2f..37979786b 100644 --- a/engine/caches.go +++ b/engine/caches.go @@ -153,3 +153,10 @@ func (chS *CacheS) V1RemoveItem(args *ArgsGetCacheItem, *reply = utils.OK return } + +func (chS *CacheS) V1Clear(cacheIDs []string, + reply *string) (err error) { + Cache.Clear(cacheIDs) + *reply = utils.OK + return +}