Pitbull Attacked Me: Am I Allowed to Defend Myself with my Firearm?

As the title says, I was attacked by a Pitbull tonight but was able to get away before it actually bit me. I kicked it a few times as it came after me.

It seems as if you are allowed to use deadly force within city limits if you think your life is in danger.

Has anyone had any experience with this, and is this guidance accurate?

Stay safe out there!