{"action":"opened","issue":{"url":"https://api.github.com/repos/pariz/gountries/issues/5","repository_url":"https://api.github.com/repos/pariz/gountries","labels_url":"https://api.github.com/repos/pariz/gountries/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/pariz/gountries/issues/5/comments","events_url":"https://api.github.com/repos/pariz/gountries/issues/5/events","html_url":"https://github.com/pariz/gountries/issues/5","id":181600799,"number":5,"title":"Embed data using go-bindata and use bi-directional map to speed up lookups","user":{"login":"BTBurke","id":414599,"avatar_url":"https://avatars.githubusercontent.com/u/414599?v=3","gravatar_id":"","url":"https://api.github.com/users/BTBurke","html_url":"https://github.com/BTBurke","followers_url":"https://api.github.com/users/BTBurke/followers","following_url":"https://api.github.com/users/BTBurke/following{/other_user}","gists_url":"https://api.github.com/users/BTBurke/gists{/gist_id}","starred_url":"https://api.github.com/users/BTBurke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BTBurke/subscriptions","organizations_url":"https://api.github.com/users/BTBurke/orgs","repos_url":"https://api.github.com/users/BTBurke/repos","events_url":"https://api.github.com/users/BTBurke/events{/privacy}","received_events_url":"https://api.github.com/users/BTBurke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-07T07:21:27Z","updated_at":"2016-10-07T07:21:27Z","closed_at":null,"body":"I'm planning on using your library as part of an API and I was going to make a few changes to get faster lookups and embed the data directly into the binary to make it easier to deploy.  Interested in a pull request?\r\n\r\nPlanned features:\r\n\r\n1.  Embed the country data from the YAML files using [go-bindata](https://github.com/jteeuwen/go-bindata) so that the deployment remains a single binary without relying on an external data directory.  This would be backwards compatible so that when you `populateCountries` or `populateSubdivisions` it checks the bindata first and then falls back to the data directory.  \r\n\r\n2.  Use a bidirectional tree map from the [gods library](https://github.com/emirpasic/gods#treebidimap) so that lookups by either country name or alpha code are more efficient.\r\n\r\n3.  Support returning either all of the data or a particular subset of countries as a struct that is easily marshaled to JSON.  This is useful to populate a frontend web UI for entering billing/shipping addresses.\r\n\r\nThis could simplify some of the query functions by using the tree to do lookups, rather than looping through all of the available data.\r\n\r\nI'm going to fork your library and work on this a little bit.  Let me know if you have any other ideas."}}
{"actor":{"display_login":"BTBurke"}}