He served for the duration of the war and spent a portion of his enlistment as the secretary to Brigadier General Nathaniel Lyon.
This passage describes someone who served in the military for the entire duration of a war, and also worked as the secretary to a general named Nathaniel Lyon.