You are, probably, experiencing a type of migraine headache.
Migraine headache is usually a one side headache, but, it can spread over the whole head, progressively intensifying.
Eye pain can be an aura symptom, and loss of consciousness, is a symptom of two rare types of migraine, known as hemiplegic migraine and basilar migraine.
Also, this case could be a seizure attack.
Headaches are common among seizures sufferers, especially, migraine ones.
With additional tests, a knowledgeable neurologist can give a correct diagnosis.
Best wishes!
Marija