Add Charger in LoaderS

This commit is contained in:
TeoV
2018-07-10 10:24:41 -04:00
committed by Dan Christian Bogos
parent eabaec98e6
commit 6764c68156

View File

@@ -19,12 +19,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package dispatcher
import (
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
func (dS *DispatcherService) ChargerSv1Ping(ign string, reply *string) error {
if dS.chargerS == nil {
return utils.NewErrNotConnected(utils.ChargerS)
return utils.NewErrNotConnected(utils.AttributeS)
}
return dS.chargerS.Call(utils.ChargerSv1Ping, ign, reply)
}
func (dS *DispatcherService) ChargerSv1GetChargersForEvent(args *ArgsAttrProcessEventWithApiKey,
reply *engine.AttributeProfile) (err error) {
if dS.attrS == nil {
return utils.NewErrNotConnected(utils.AttributeS)
}
if err = dS.authorize(utils.AttributeSv1GetAttributeForEvent, args.AttrArgsProcessEvent.CGREvent.Tenant,
args.APIKey, args.AttrArgsProcessEvent.CGREvent.Time); err != nil {
return
}
return dS.attrS.Call(utils.AttributeSv1GetAttributeForEvent, args.AttrArgsProcessEvent, reply)
}