mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 00:28:44 +05:00
CacheSv1.HasGroup API
This commit is contained in:
@@ -75,8 +75,14 @@ func (chSv1 *CacheSv1) PrecacheStatus(cacheIDs []string, rply *map[string]string
|
||||
return chSv1.cacheS.V1PrecacheStatus(cacheIDs, rply)
|
||||
}
|
||||
|
||||
// HasGroup checks existence of a group in cache
|
||||
func (chSv1 *CacheSv1) HasGroup(args *engine.ArgsGetGroup,
|
||||
rply *bool) (err error) {
|
||||
return chSv1.cacheS.V1HasGroup(args, rply)
|
||||
}
|
||||
|
||||
// GetGroupItemIDs returns a list of itemIDs in a cache group
|
||||
func (chSv1 *CacheSv1) GetGroupItemIDs(args *engine.ArgsGetGroupItems,
|
||||
func (chSv1 *CacheSv1) GetGroupItemIDs(args *engine.ArgsGetGroup,
|
||||
rply *[]string) (err error) {
|
||||
return chSv1.cacheS.V1GetGroupItemIDs(args, rply)
|
||||
}
|
||||
|
||||
@@ -191,13 +191,22 @@ func (chS *CacheS) V1PrecacheStatus(cacheIDs []string, rply *map[string]string)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsGetGroupItems struct {
|
||||
type ArgsGetGroup struct {
|
||||
CacheID string
|
||||
GroupID string
|
||||
}
|
||||
|
||||
func (chS *CacheS) V1GetGroupItemIDs(args *ArgsGetGroupItems,
|
||||
func (chS *CacheS) V1HasGroup(args *ArgsGetGroup,
|
||||
rply *bool) (err error) {
|
||||
*rply = Cache.HasGroup(args.CacheID, args.GroupID)
|
||||
return
|
||||
}
|
||||
|
||||
func (chS *CacheS) V1GetGroupItemIDs(args *ArgsGetGroup,
|
||||
rply *[]string) (err error) {
|
||||
if has := Cache.HasGroup(args.CacheID, args.GroupID); !has {
|
||||
return utils.ErrNotFound
|
||||
}
|
||||
*rply = Cache.GetGroupItemIDs(args.CacheID, args.GroupID)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user