A diagnosis of cancer is a great shock. My son was diagnosed last year so I have some idea of the way you are feeling.
Firstly, you need to find out what type of cancer you have. Many are treatable and even those with poorer prognose are now better understood. Keep positive, very positive and don't depress yourself by reading a lot of outdated information on the web. I found a report by the Royal Marsden about the prognoses for the type of sarcoma my son had and it stated that much of the information available to the public was based on cases going back to the 1980s, when treatment was quite crude, drugs were of a general nature and not targetted, and there were many instances of misdiagnosis in the past which had led to the problem getting worse. The Royal Marsden found from the records that they could gather that survival rates in 1980s were worse, the 1990s were improved and after 2000 they became much better. This simply reflects an improvement in understanding and which of several approaches the practioners should take.
Having spoken to many survivors since my son's diagnosis, a lot come through it despite poor prognoses. They were all very positive. Even my friend's mum , who was given two years back in the 1990s, is still with us, fit as a fiddle and approaching her 80th birthday. Stay positive and surround yourself with positive people.