Example #1
0
func getString(c *goconfig.ConfigFile, section, option string) string {
	value, err := c.GetString(section, option)
	if err != nil {
		log.Println(section, ":", option)
		log.Fatal(err)
	}
	if value == "" {
		log.Fatalf("No value for option '%v' in section '%v'.", option, section)
	}
	return value
}
Example #2
0
func parsePlatformAppConfig(awsConfig *goconfig.ConfigFile) map[string]PlatformApp {
	platformApps, err := awsConfig.GetString("default", "platform-applications")
	checkError("Unable to find AWS Platform Apps List", err)
	platformAppsMap := make(map[string]PlatformApp)
	for _, platformApp := range strings.Split(platformApps, ",") {
		arn, err := awsConfig.GetString(platformApp, "arn")
		checkError("Unable to find AWS ARN for app "+platformApp, err)

		typeValue, err := awsConfig.GetString(platformApp, "type")
		checkError("Unable to find AWS type for app "+platformApp, err)

		platformAppsMap[platformApp] = PlatformAppStruct{arn, typeValue}

	}
	return platformAppsMap
}
Example #3
0
func parseBaseConfig(baseConfig *goconfig.ConfigFile) {
	port, err := baseConfig.GetString("default", "port")
	checkError("Unable to find Server Port", err)
	baseConfigInstance = BaseConfigStruct{port}
}