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 }
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 }
func parseBaseConfig(baseConfig *goconfig.ConfigFile) { port, err := baseConfig.GetString("default", "port") checkError("Unable to find Server Port", err) baseConfigInstance = BaseConfigStruct{port} }