mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
CacheSv1.GetItemIDs API
This commit is contained in:
@@ -33,8 +33,14 @@ type CacheSv1 struct {
|
||||
cacheS *engine.CacheS
|
||||
}
|
||||
|
||||
// GetItemExpiryTime re
|
||||
// GetItemExpiryTime returns the expiryTime for an item
|
||||
func (chSv1 *CacheSv1) GetItemExpiryTime(args *engine.ArgsGetCacheItem,
|
||||
reply *time.Time) error {
|
||||
return chSv1.cacheS.V1GetItemExpiryTime(args, reply)
|
||||
}
|
||||
|
||||
// GetItemExpiryTime returns the expiryTime for an item
|
||||
func (chSv1 *CacheSv1) GetItemIDs(args *engine.ArgsGetCacheItemIDs,
|
||||
reply *[]string) error {
|
||||
return chSv1.cacheS.V1GetItemIDs(args, reply)
|
||||
}
|
||||
|
||||
@@ -125,3 +125,18 @@ func (chS *CacheS) V1GetItemExpiryTime(args *ArgsGetCacheItem,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsGetCacheItemIDs struct {
|
||||
CacheID string
|
||||
ItemIDPrefix string
|
||||
}
|
||||
|
||||
func (chS *CacheS) V1GetItemIDs(args *ArgsGetCacheItemIDs,
|
||||
reply *[]string) (err error) {
|
||||
if itmIDs := Cache.GetItemIDs(args.CacheID, args.ItemIDPrefix); len(itmIDs) == 0 {
|
||||
return utils.ErrNotFound
|
||||
} else {
|
||||
*reply = itmIDs
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user