import reporter.Reporters as Reporters
from configs import ConfigLoader as ConfigLoader


def getInstance(name='dingrobot', configFile='configs/config.json'):
    config = ConfigLoader.loadConfig(configFile)
    if name == "jpush":
        return Reporters.JPusher(config['jpush']['key'], config['jpush']['secret'])
    elif name == "dingrobot":
        return Reporters.DingRobot(config['ding']['url'], config['ding']['tag'])