func (service *UpdownMonitorService) addAnnotationConfigToHttpCheck(updownCheckItemObj *updown.CheckItem, annotations map[string]string) {
	// Read known annotations, try to map them to updown check configs
	// set some default values if we can't find them

	log.Println("Updown monitor's addAnnotationConfigToHttpCheck method has been called")

	// Enable Annotation
	if value, ok := annotations[UpdownEnableCheckAnnotation]; ok {
		boolValue, err := strconv.ParseBool(value)

		if err == nil {
			updownCheckItemObj.Enabled = boolValue

		} else {
			log.Println("Error decoding input into an boolean")
			updownCheckItemObj.Enabled = UpdownEnableAnnotationDefaultValue

		}
	}

	// Published Annotation
	if value, ok := annotations[UpdownPublishPageAnnotation]; ok {
		boolValue, err := strconv.ParseBool(value)

		if err == nil {
			updownCheckItemObj.Published = boolValue

		} else {
			log.Println("Error decoding input into an boolean")
			updownCheckItemObj.Published = UpdownPublishedAnnotationDefaultValue

		}
	}

	// Period Annotation
	if value, ok := annotations[UpdownPeriodAnnotation]; ok {
		intValue, err := strconv.Atoi(value)

		if err == nil {
			updownCheckItemObj.Period = intValue

		} else {
			log.Println("Error decoding input into an integer")
			updownCheckItemObj.Period = UpdownPeriodAnnotationDefaultValue

		}

	} else {
		updownCheckItemObj.Period = UpdownPeriodAnnotationDefaultValue

	}

}
// addAnnotationConfigToHttpCheck method will populate Updown's CheckItem object attributes using the annotations map
addAnnotationConfigToHttpCheck method will populate Updown's CheckItem object attributes using the annotations map
// addAnnotationConfigToHttpCheck method will populate Updown ' s CheckItem object attributes using the annotations map
func (service *UpdownMonitorService) addAnnotationConfigToHttpCheck(updownCheckItemObj *updown.CheckItem, annotations map[string]string) {
	log.Println("Updown monitor's addAnnotationConfigToHttpCheck method has been called")
	if value, ok := annotations[UpdownEnableCheckAnnotation]; ok {
		boolValue, err := strconv.ParseBool(value)
		if err == nil {
			updownCheckItemObj.Enabled = boolValue
		} else {
			log.Println("Error decoding input into an boolean")
			updownCheckItemObj.Enabled = UpdownEnableAnnotationDefaultValue
		}
	}
	if value, ok := annotations[UpdownPublishPageAnnotation]; ok {
		boolValue, err := strconv.ParseBool(value)
		if err == nil {
			updownCheckItemObj.Published = boolValue
		} else {
			log.Println("Error decoding input into an boolean")
			updownCheckItemObj.Published = UpdownPublishedAnnotationDefaultValue
		}
	}
	if value, ok := annotations[UpdownPeriodAnnotation]; ok {
		intValue, err := strconv.Atoi(value)
		if err == nil {
			updownCheckItemObj.Period = intValue
		} else {
			log.Println("Error decoding input into an integer")
			updownCheckItemObj.Period = UpdownPeriodAnnotationDefaultValue
		}
	} else {
		updownCheckItemObj.Period = UpdownPeriodAnnotationDefaultValue
	}
}
func ( service * UpdownMonitorService ) addAnnotationConfigToHttpCheck ( updownCheckItemObj * updown . CheckItem , annotations map [ string ] string ) { log . Println ( " " ) if value , ok := annotations [ UpdownEnableCheckAnnotation ] ; ok { boolValue , err := strconv . ParseBool ( value ) if err == nil { updownCheckItemObj . Enabled = boolValue } else { log . Println ( " " ) updownCheckItemObj . Enabled = UpdownEnableAnnotationDefaultValue } } if value , ok := annotations [ UpdownPublishPageAnnotation ] ; ok { boolValue , err := strconv . ParseBool ( value ) if err == nil { updownCheckItemObj . Published = boolValue } else { log . Println ( " " ) updownCheckItemObj . Published = UpdownPublishedAnnotationDefaultValue } } if value , ok := annotations [ UpdownPeriodAnnotation ] ; ok { intValue , err := strconv . Atoi ( value ) if err == nil { updownCheckItemObj . Period = intValue } else { log . Println ( " " ) updownCheckItemObj . Period = UpdownPeriodAnnotationDefaultValue } } else { updownCheckItemObj . Period = UpdownPeriodAnnotationDefaultValue } }
addAnnotationConfigToHttpCheck method will populate Updown's CheckItem object attributes using the annotations map
addAnnotationConfigToHttpCheck method will populate Updown ' s CheckItem object attributes using the annotations map
// Read known annotations, try to map them to updown check configs // set some default values if we can't find them // Enable Annotation // Published Annotation // Period Annotation