func (updownService *UpdownMonitorService) GetByName(monitorName string) (*models.Monitor, error) {

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

	updownMonitors := updownService.GetAll()
	log.Println("Monitors (updown checks) object list has been pulled")

	log.Println("Searching the monitor from monitors object list using its name")
	for _, updownMonitor := range updownMonitors {
		if updownMonitor.Name == monitorName {
			// Test the code below
			return &updownMonitor, nil
		}
	}

	return nil, fmt.Errorf("Unable to locate %v monitor", monitorName)
}
// GetByName function will return a monitor(updown check) object based on the name provided
GetByName function will return a monitor(updown check) object based on the name provided
// GetByName function will return a monitor ( updown check ) object based on the name provided
func (updownService *UpdownMonitorService) GetByName(monitorName string) (*models.Monitor, error) {
	log.Println("Updown monitor's GetByName method has been called")
	updownMonitors := updownService.GetAll()
	log.Println("Monitors (updown checks) object list has been pulled")
	log.Println("Searching the monitor from monitors object list using its name")
	for _, updownMonitor := range updownMonitors {
		if updownMonitor.Name == monitorName {
			return &updownMonitor, nil
		}
	}
	return nil, fmt.Errorf("Unable to locate %v monitor", monitorName)
}
func ( updownService * UpdownMonitorService ) GetByName ( monitorName string ) ( * models . Monitor , error ) { log . Println ( " " ) updownMonitors := updownService . GetAll ( ) log . Println ( " " ) log . Println ( " " ) for _ , updownMonitor := range updownMonitors { if updownMonitor . Name == monitorName { return & updownMonitor , nil } } return nil , fmt . Errorf ( " " , monitorName ) }
GetByName function will return a monitor(updown check) object based on the name provided
GetByName function will return a monitor ( updown check ) object based on the name provided
// Test the code below