Update CacheSv1 API's to accept ArgDispatcher parameters

This commit is contained in:
TeoV
2019-05-09 13:24:48 +03:00
committed by Dan Christian Bogos
parent f4eba504a5
commit 2a90b270f6
32 changed files with 282 additions and 274 deletions

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package console
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -27,7 +26,7 @@ func init() {
c := &CmdCacheGetGroupItemIDs{
name: "cache_group_item_ids",
rpcMethod: utils.CacheSv1GetGroupItemIDs,
rpcParams: &engine.ArgsGetGroup{},
rpcParams: &utils.ArgsGetGroup{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +36,7 @@ func init() {
type CmdCacheGetGroupItemIDs struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetGroup
rpcParams *utils.ArgsGetGroup
*CommandExecuter
}
@@ -51,7 +50,7 @@ func (self *CmdCacheGetGroupItemIDs) RpcMethod() string {
func (self *CmdCacheGetGroupItemIDs) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ArgsGetGroup{}
self.rpcParams = &utils.ArgsGetGroup{}
}
return self.rpcParams
}

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package console
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -27,7 +26,7 @@ func init() {
c := &CmdCacheHasGroup{
name: "cache_has_group",
rpcMethod: utils.CacheSv1HasGroup,
rpcParams: &engine.ArgsGetGroup{},
rpcParams: &utils.ArgsGetGroup{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +36,7 @@ func init() {
type CmdCacheHasGroup struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetGroup
rpcParams *utils.ArgsGetGroup
*CommandExecuter
}
@@ -51,7 +50,7 @@ func (self *CmdCacheHasGroup) RpcMethod() string {
func (self *CmdCacheHasGroup) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ArgsGetGroup{}
self.rpcParams = &utils.ArgsGetGroup{}
}
return self.rpcParams
}

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package console
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -27,7 +26,7 @@ func init() {
c := &CmdCacheHasItem{
name: "cache_has_item",
rpcMethod: utils.CacheSv1HasItem,
rpcParams: &engine.ArgsGetCacheItem{},
rpcParams: &utils.ArgsGetCacheItem{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +36,7 @@ func init() {
type CmdCacheHasItem struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetCacheItem
rpcParams *utils.ArgsGetCacheItem
*CommandExecuter
}
@@ -51,7 +50,7 @@ func (self *CmdCacheHasItem) RpcMethod() string {
func (self *CmdCacheHasItem) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ArgsGetCacheItem{}
self.rpcParams = &utils.ArgsGetCacheItem{}
}
return self.rpcParams
}

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package console
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -27,7 +26,7 @@ func init() {
c := &CmdCacheGetItemExpiryTime{
name: "cache_item_expiry_time",
rpcMethod: utils.CacheSv1GetItemExpiryTime,
rpcParams: &engine.ArgsGetCacheItem{},
rpcParams: &utils.ArgsGetCacheItem{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +36,7 @@ func init() {
type CmdCacheGetItemExpiryTime struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetCacheItem
rpcParams *utils.ArgsGetCacheItem
*CommandExecuter
}
@@ -51,7 +50,7 @@ func (self *CmdCacheGetItemExpiryTime) RpcMethod() string {
func (self *CmdCacheGetItemExpiryTime) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ArgsGetCacheItem{}
self.rpcParams = &utils.ArgsGetCacheItem{}
}
return self.rpcParams
}

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package console
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -27,7 +26,7 @@ func init() {
c := &CmdCacheGetItemIDs{
name: "cache_item_ids",
rpcMethod: utils.CacheSv1GetItemIDs,
rpcParams: &engine.ArgsGetCacheItemIDs{},
rpcParams: &utils.ArgsGetCacheItemIDs{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +36,7 @@ func init() {
type CmdCacheGetItemIDs struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetCacheItemIDs
rpcParams *utils.ArgsGetCacheItemIDs
*CommandExecuter
}
@@ -51,7 +50,7 @@ func (self *CmdCacheGetItemIDs) RpcMethod() string {
func (self *CmdCacheGetItemIDs) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ArgsGetCacheItemIDs{}
self.rpcParams = &utils.ArgsGetCacheItemIDs{}
}
return self.rpcParams
}

View File

@@ -33,7 +33,7 @@ func init() {
type CmdReloadCache struct {
name string
rpcMethod string
rpcParams *utils.AttrReloadCache
rpcParams *utils.AttrReloadCacheWithArgDispatcher
rpcResult string
*CommandExecuter
}
@@ -48,7 +48,7 @@ func (self *CmdReloadCache) RpcMethod() string {
func (self *CmdReloadCache) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &utils.AttrReloadCache{}
self.rpcParams = &utils.AttrReloadCacheWithArgDispatcher{}
}
return self.rpcParams
}

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package console
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -27,7 +26,7 @@ func init() {
c := &CmdCacheRemoveGroup{
name: "cache_remove_group",
rpcMethod: utils.CacheSv1RemoveGroup,
rpcParams: &engine.ArgsGetGroup{},
rpcParams: &utils.ArgsGetGroup{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +36,7 @@ func init() {
type CmdCacheRemoveGroup struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetGroup
rpcParams *utils.ArgsGetGroup
*CommandExecuter
}
@@ -51,7 +50,7 @@ func (self *CmdCacheRemoveGroup) RpcMethod() string {
func (self *CmdCacheRemoveGroup) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ArgsGetGroup{}
self.rpcParams = &utils.ArgsGetGroup{}
}
return self.rpcParams
}

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package console
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -27,7 +26,7 @@ func init() {
c := &CmdCacheRemoveItem{
name: "cache_remove_item",
rpcMethod: utils.CacheSv1RemoveItem,
rpcParams: &engine.ArgsGetCacheItem{},
rpcParams: &utils.ArgsGetCacheItem{},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}
@@ -37,7 +36,7 @@ func init() {
type CmdCacheRemoveItem struct {
name string
rpcMethod string
rpcParams *engine.ArgsGetCacheItem
rpcParams *utils.ArgsGetCacheItem
*CommandExecuter
}
@@ -51,7 +50,7 @@ func (self *CmdCacheRemoveItem) RpcMethod() string {
func (self *CmdCacheRemoveItem) RpcParams(reset bool) interface{} {
if reset || self.rpcParams == nil {
self.rpcParams = &engine.ArgsGetCacheItem{}
self.rpcParams = &utils.ArgsGetCacheItem{}
}
return self.rpcParams
}