zph/go-whois — pull request #2 by joedursun (2014-07-15 22:13:27+00:00)
Title: Store emails in db

**WARNING**: There is currently no protection against sql injection. This is just a simple way to speed up repeated lookups and to circumvent being rate limited. **Do not use if you don't trust the data coming in**.

This branch adds the ability to store the whois data in a sql database. The raw whois data, along with the domain name and list of found emails, is stored in sqlite; swapping out sql databases should be as easy as changing adapters at the top of ./server.go. To keep the size of the database from growing too quickly we should consider only storing the domain and emails, but for now all data is being stored (for debugging purposes).

Some of the new functions can be refactored to be more DRY; I'll come back at a later date and fix that.

Another field I considered adding was "dateRetrieved" so we could request fresh data if it's "been a while." Again, I'll come back and add that feature later as well.