in pkg/settings/settings.go [49:78]
func GetHandlerSettings(el logging.ILogger, he *handlerenv.HandlerEnvironment, seqNo uint) (hs *HandlerSettings, _ error) {
// The file will be under the config folder with the path {seqNo}.settings
settingsFileName := filepath.Join(he.ConfigFolder, fmt.Sprintf("%d%s", seqNo, settingsFileSuffix))
parsedHs, err := parseHandlerSettingsFile(el, settingsFileName)
if err != nil {
return hs, err
}
protectedSettings, err := unmarshalProtectedSettings(el, he.ConfigFolder, parsedHs)
if err != nil {
return hs, err
}
var publicSettingJsonString = ""
// parsedHS.PublicSettings is an interface, has to be marshaled to get the string representation
if parsedHs.PublicSettings != nil {
jsonBytes, err := json.Marshal(parsedHs.PublicSettings)
if err != nil {
return hs, err
}
publicSettingJsonString = string(jsonBytes)
}
hs = &HandlerSettings{
PublicSettings: publicSettingJsonString,
ProtectedSettings: protectedSettings,
}
return hs, nil
}