Ejemplo n.º 1
0
func LoadConfig() (RdpgIntegrationConfig, error) {
	config := RdpgIntegrationConfig{}

	path := os.Getenv("CONFIG")
	if path == "" {
		return config, fmt.Errorf("Must set $CONFIG to point to an integration config .json file.")
	}

	err := services.LoadConfig(path, &config)
	if err != nil {
		return config, fmt.Errorf("Loading config: %s", err.Error())
	}

	return config, nil
}
func LoadConfig() (MysqlIntegrationConfig, error) {
	config := MysqlIntegrationConfig{}

	path := os.Getenv("CONFIG")
	if path == "" {
		return config, fmt.Errorf("Must set $CONFIG to point to an integration config .json file.")
	}

	err := services.LoadConfig(path, &config)
	if err != nil {
		return config, fmt.Errorf("Loading config: %s", err.Error())
	}

	if config.BrokerProtocol == "" {
		config.BrokerProtocol = "https"
	}

	return config, nil
}