It's an awful blow, and a lot to process.
I don't know your situation, if you have close family, or kids, but one thing I'd offer ..
.. you're not dead yet.
Cancer treatment these days is progressing rapidly - some scientists believe that we're inching ever closer toward a cure (and apparently some of those scientists - generally micro-biologists specialising in cancer and human immunology - tend to think that the key is finding was for your immune system to tag the cancer, and then super-boost immunity so that you can destroy it yourself ... leaving some of the more barbaric orthodox treatments - blasting with rads and toxic chemicals - by the wayside).
One thing I'd suggest you do: ask everybody - every single oncologist or cancer care person you come across "can you get me into a clinical trial". Even if the treatment is considered palliative, or to give you extra time .. approach it in the hope of being surprised.
You can't control cancer - but you can control how you approach it. I'd urge you to fight, even if the doctors say there's no hope of overcoming the disease.
Best of luck, and sorry to hear about the bad news.
Be part of this supportive community