my dog has cancer

I just found out my sweet baby has a mammary tumor that is malignant. She Is scheduled to have surgery but the vet said the cancer has likely already spread to her lymph nodes. She is my first dog i’ve ever had and the sweetest girl ever. I have only had her for two years but she is a part of my soul and she is what gets me through every day i can’t imagine life without her. I have been crying non stop this week and I just don’t know what to do. She is a rescue and she is i think about 10 years old so I knew she wouldnt be around for so long because she is old but i thought she would be with me for at least a couple of years. I’m not ready to live without her and I can’t bear the thought of her being in pain. I love her so so much and I don’t know how I can go back to my life with this news and I don’t even want to think about dealing with her passing. I just hope someone on here can have some words of support to help me gain perspective and get through this.