From 0a1626cd4f74b2418d8eb38454e87a3ab1175582 Mon Sep 17 00:00:00 2001 From: DanB Date: Fri, 9 Mar 2018 19:11:12 +0100 Subject: [PATCH] CacheSv1.GetGroupItemIDs API --- apier/v1/caches.go | 7 +++++++ engine/caches.go | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/apier/v1/caches.go b/apier/v1/caches.go index 2d029971c..0ea876a5e 100644 --- a/apier/v1/caches.go +++ b/apier/v1/caches.go @@ -70,6 +70,13 @@ func (chSv1 *CacheSv1) GetCacheStats(cacheIDs []string, return chSv1.cacheS.V1GetCacheStats(cacheIDs, rply) } +// PrecacheStatus checks status of active precache processes func (chSv1 *CacheSv1) PrecacheStatus(cacheIDs []string, rply *map[string]string) error { return chSv1.cacheS.V1PrecacheStatus(cacheIDs, rply) } + +// GetGroupItemIDs returns a list of itemIDs in a cache group +func (chSv1 *CacheSv1) GetGroupItemIDs(args *engine.ArgsGetGroupItems, + rply *[]string) (err error) { + return chSv1.cacheS.V1GetGroupItemIDs(args, rply) +} diff --git a/engine/caches.go b/engine/caches.go index aeb70b909..c4e81fcda 100644 --- a/engine/caches.go +++ b/engine/caches.go @@ -190,3 +190,14 @@ func (chS *CacheS) V1PrecacheStatus(cacheIDs []string, rply *map[string]string) *rply = pCacheStatus return } + +type ArgsGetGroupItems struct { + CacheID string + GroupID string +} + +func (chS *CacheS) V1GetGroupItemIDs(args *ArgsGetGroupItems, + rply *[]string) (err error) { + *rply = Cache.GetGroupItemIDs(args.CacheID, args.GroupID) + return +}