Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
NOTE
I've been looking around at different ORMs for Go and it looks like this one is more established than Gorp: https://github.com/go-xorm/xorm
I'll come back and switch out the ORM for Xorm soon.