code: func couchdbIndexFileValidator(fileName string, fileBytes []byte) error {
  
  	// if the content does not validate as JSON, return err to invalidate the file
  	boolIsJSON, indexDefinition := isJSON(fileBytes)
  	if !boolIsJSON {
  		return &InvalidIndexContentError{fmt.Sprintf("Index metadata file [%s] is not a valid JSON", fileName)}
  	}
  
  	// validate the index definition
  	err := validateIndexJSON(indexDefinition)
  	if err != nil {
  		return &InvalidIndexContentError{fmt.Sprintf("Index metadata file [%s] is not a valid index definition: %s", fileName, err)}
  	}
  
  	return nil
  
  }
docs: // couchdbIndexFileValidator implements fileValidator