Translation:She wrote her memoirs while knowing that she was going to die.
I'm often fascinated at the similarities between two languages when "exceptions" are used in the same way. In this case we have "that she was going to die" using a past tense (imperfect) of "to go" to signify something that will happen in the future. In French the same thing is being done. I would guess that the conditional could be used in both languages to convey the same thing: "that she would die" or "qu'elle mourrait", but I don't know if this conveys a future action in French as it implies in English.