K.B.
HI S.! I totally understand your situation and want you to know that many mothers have been able to breastfeed through a surgery and have found it to be the best not only for their babies but also for their recovery! You can look up specific medications through Dr. Hales website online. http://neonatal.ttuhsc.edu/lact/medicationforumspage.html
He is a breastfeeding pharmacologist who studies medicines and their passage in breastmilk. You can also contact your local LLL leader and have them look up specific meds that are compatible with breastfeeding, so that you can work with your doctor to find something that works. (Most medications have little passage into the breastmilk and/or little long term effect for the child. The risk of weaning him before he is ready is usually more severe.) I had anesthethia and pain meds and continued to nurse my 10 month old, but again, you'll want to take into account dosage, age of infant, how often they nurse..... I think you will find the help of an experience LLL leader priceless to get you and your son through this surgery as a breastfeeding duo. http://www.llli.org/WebUS.html
I wish you well with the surgery and I know you'll get through it! Let me know if I can help out any more with information or support.
K.