func (updownService *UpdownMonitorService) GetAll() []models.Monitor {

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

	var monitors []models.Monitor

	// getting all monitors(checks) list
	updownChecks, httpResponse, err := updownService.client.Check.List()
	log.Println("Monitors (updown checks) object list has been pulled")

	if (httpResponse.StatusCode == http.StatusOK) && (err == nil) {
		log.Println("Populating monitors list using the updownChecks object given in updownChecks list")

		// populating a monitors slice using the updownChecks objects given in updownChecks slice
		for _, updownCheck := range updownChecks {
			newMonitor := models.Monitor{
				URL:  updownCheck.URL,
				Name: updownCheck.Alias,
				ID:   updownCheck.Token,
			}
			monitors = append(monitors, newMonitor)
		}
		return monitors

	} else {
		log.Println("Unable to get updown provider checks(monitor) list")
		return nil

	}

}
// GetAll function will return all monitors (updown checks) object in an array
GetAll function will return all monitors (updown checks) object in an array
// GetAll function will return all monitors ( updown checks ) object in an array
func (updownService *UpdownMonitorService) GetAll() []models.Monitor {
	log.Println("Updown monitor's GetAll method has been called")
	var monitors []models.Monitor
	updownChecks, httpResponse, err := updownService.client.Check.List()
	log.Println("Monitors (updown checks) object list has been pulled")
	if (httpResponse.StatusCode == http.StatusOK) && (err == nil) {
		log.Println("Populating monitors list using the updownChecks object given in updownChecks list")
		for _, updownCheck := range updownChecks {
			newMonitor := models.Monitor{
				URL:  updownCheck.URL,
				Name: updownCheck.Alias,
				ID:   updownCheck.Token,
			}
			monitors = append(monitors, newMonitor)
		}
		return monitors
	} else {
		log.Println("Unable to get updown provider checks(monitor) list")
		return nil
	}
}
func ( updownService * UpdownMonitorService ) GetAll ( ) [ ] models . Monitor { log . Println ( " " ) var monitors [ ] models . Monitor updownChecks , httpResponse , err := updownService . client . Check . List ( ) log . Println ( " " ) if ( httpResponse . StatusCode == http . StatusOK ) && ( err == nil ) { log . Println ( " " ) for _ , updownCheck := range updownChecks { newMonitor := models . Monitor { URL : updownCheck . URL , Name : updownCheck . Alias , ID : updownCheck . Token , } monitors = append ( monitors , newMonitor ) } return monitors } else { log . Println ( " " ) return nil } }
GetAll function will return all monitors (updown checks) object in an array
GetAll function will return all monitors ( updown checks ) object in an array
// getting all monitors(checks) list // populating a monitors slice using the updownChecks objects given in updownChecks slice