{"action":"created","comment":{"url":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/comments/75411084","id":75411084,"diff_hunk":"@@ -0,0 +1,84 @@\n+package psql\n+\n+import (\n+\t\"github.com/KloudKtrl/internal/database\"\n+\t\"io\"\n+\t\"time\"\n+)\n+\n+type (\n+\tPQAsset struct {\n+\t\tstore.Asset\n+\t}\n+\n+\tPQDB struct {\n+\t\tDB *db.Database\n+\t}\n+\n+\tPQAssetService struct {\n+\t\tPQDB\n+\t}\n+\n+\tPQVersion struct {\n+\t\tstore.Version\n+\t}\n+\n+\tPQVersionService struct {\n+\t\tPQDB\n+\t}\n+\n+\tPQMeta struct {\n+\t\tstore.Metadata\n+\t}\n+\n+\tPQMetaService struct {\n+\t\tPQDB\n+\t}\n+\n+\tPQObject struct {\n+\t\tstore.Object\n+\t}\n+\n+\tPQObjectService struct {\n+\t\tPQDB\n+\t}\n+\n+\tPQServices struct {","path":"domain/data/store/psql/implementation.go","position":46,"original_position":46,"commit_id":"459368ba73a45483dfe484a3bce0e5607b8d5a91","original_commit_id":"459368ba73a45483dfe484a3bce0e5607b8d5a91","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"exported type PQServices should have comment or be unexported","created_at":"2016-08-19T00:11:24Z","updated_at":"2016-08-19T00:11:24Z","html_url":"https://github.com/KloudKtrl/asset-service/pull/3#discussion_r75411084","pull_request_url":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/comments/75411084"},"html":{"href":"https://github.com/KloudKtrl/asset-service/pull/3#discussion_r75411084"},"pull_request":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/3","id":81908786,"html_url":"https://github.com/KloudKtrl/asset-service/pull/3","diff_url":"https://github.com/KloudKtrl/asset-service/pull/3.diff","patch_url":"https://github.com/KloudKtrl/asset-service/pull/3.patch","issue_url":"https://api.github.com/repos/KloudKtrl/asset-service/issues/3","number":3,"state":"open","locked":false,"title":"Thinking about interfaces VS structs","user":{"login":"seanhagen","id":444767,"avatar_url":"https://avatars.githubusercontent.com/u/444767?v=3","gravatar_id":"","url":"https://api.github.com/users/seanhagen","html_url":"https://github.com/seanhagen","followers_url":"https://api.github.com/users/seanhagen/followers","following_url":"https://api.github.com/users/seanhagen/following{/other_user}","gists_url":"https://api.github.com/users/seanhagen/gists{/gist_id}","starred_url":"https://api.github.com/users/seanhagen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanhagen/subscriptions","organizations_url":"https://api.github.com/users/seanhagen/orgs","repos_url":"https://api.github.com/users/seanhagen/repos","events_url":"https://api.github.com/users/seanhagen/events{/privacy}","received_events_url":"https://api.github.com/users/seanhagen/received_events","type":"User","site_admin":false},"body":"**First pass at data model**\n\n**Add more fields to various structs**\n\n**Add more fields, as well as begin defining services**\n\n**Merge branch 'master' into setting-up-data-model**\n\n**Remove deps from test target**\nTravis already does this, doing it twice just makes the build take even longer.\n\n**Fix import error**\n\n**More tweaking of the data model**\n\n**Fix install target in Makefile**\n\n**Remove coverage files after running tests**\n\n**Remove json type hints from structs**\nThese are just internal structs, only to be used by the Asset service.\n\n**Add a presenter struct & interface**\nFirst draft of a presenter pattern.\n\nThe idea is that the presenter will take in a `model/Asset` ( and\noptionally a `model/Version`, `model/Metadata`, etc) and transform it\ninto the desired output format.\n\nConcrete implementations will deal with outputting JSON, etc.\n\n**Change Marshall/Unmarshall to use `DisplayAsset`**\nThe presenters package shouldn't depend on the models package\n\n**Change structs to pointers to structs**\nAlso added a 'number' field to the Version strcut\n\n**Define the interface used to create a DisplayAsset**\nThe `model.Create(AssetPresenter)` method uses anything that implements\nthese interfaces to build a DisplayAsset for use by an encoder.\n\n**Start defining the tables**\n\n**Remove 'Get' from getters**\nWe all know these are getters, don't need to prefix each method with 'Get'\n\n**Start figuring out how to switch to interfaces**\nI can't decide if the top level data model should be a struct or an\ninterface. If it's a struct, then it probably needs to have tags that\ndefine db fields -- because we're using sqlx we can just pass in an\ninterface and sqlx uses tags to load data from a SELECT query into the\nstruct.\n\nOn the other hand, if we just use an interface, then we don't even have\nto rely on `database/sql`. As long as we've got setters for the fields (\nor maybe a single setter that takes a `map[string]interface{}` ), then\nit doesn't matter what data store is backing the\nAssets/Versions/etc. The AssetService would be an interface looking\nsomething like this:\n\n```\nAssetService interface {\n  Load(uuid string) (Asset, error)\n}\n```\n\nWhere `Asset` is the interface. Then as long as that interface has\nmethods for setting properties, the AssetService can use whatever damn\nlibrary it chooses, so we're not tied to SQL ( ie, we could easily write\na service that uses Mongo or ElasticSearch as a backing store ). On the\nflip side, most libraries that pull from data stores understand tags, so\nmaybe we just end up with an Asset struct that looks like this:\n\n```\nAsset struct {\n      ID string `db:\"uuid\" mongo:\"id\" es:\"_id\"`\n}\n```\n\nIE, the \"stuff all the different data store mappings into the tag\"\nmethod.\n\nFor now, just going to go with structs for the model, and whip up some\nservices. Wanted to throw this noodling into a branch though, so it\ndoesn't disappear.\n\n","created_at":"2016-08-19T00:11:16Z","updated_at":"2016-08-19T00:11:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b9a313a86aabe2784517b1734d05f5149798bc8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/3/commits","review_comments_url":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/3/comments","review_comment_url":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KloudKtrl/asset-service/issues/3/comments","statuses_url":"https://api.github.com/repos/KloudKtrl/asset-service/statuses/459368ba73a45483dfe484a3bce0e5607b8d5a91","head":{"label":"KloudKtrl:thinking-about-interfaces","ref":"thinking-about-interfaces","sha":"459368ba73a45483dfe484a3bce0e5607b8d5a91","user":{"login":"KloudKtrl","id":18446918,"avatar_url":"https://avatars.githubusercontent.com/u/18446918?v=3","gravatar_id":"","url":"https://api.github.com/users/KloudKtrl","html_url":"https://github.com/KloudKtrl","followers_url":"https://api.github.com/users/KloudKtrl/followers","following_url":"https://api.github.com/users/KloudKtrl/following{/other_user}","gists_url":"https://api.github.com/users/KloudKtrl/gists{/gist_id}","starred_url":"https://api.github.com/users/KloudKtrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KloudKtrl/subscriptions","organizations_url":"https://api.github.com/users/KloudKtrl/orgs","repos_url":"https://api.github.com/users/KloudKtrl/repos","events_url":"https://api.github.com/users/KloudKtrl/events{/privacy}","received_events_url":"https://api.github.com/users/KloudKtrl/received_events","type":"Organization","site_admin":false},"repo":{"id":65763239,"name":"asset-service","full_name":"KloudKtrl/asset-service","owner":{"login":"KloudKtrl","id":18446918,"avatar_url":"https://avatars.githubusercontent.com/u/18446918?v=3","gravatar_id":"","url":"https://api.github.com/users/KloudKtrl","html_url":"https://github.com/KloudKtrl","followers_url":"https://api.github.com/users/KloudKtrl/followers","following_url":"https://api.github.com/users/KloudKtrl/following{/other_user}","gists_url":"https://api.github.com/users/KloudKtrl/gists{/gist_id}","starred_url":"https://api.github.com/users/KloudKtrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KloudKtrl/subscriptions","organizations_url":"https://api.github.com/users/KloudKtrl/orgs","repos_url":"https://api.github.com/users/KloudKtrl/repos","events_url":"https://api.github.com/users/KloudKtrl/events{/privacy}","received_events_url":"https://api.github.com/users/KloudKtrl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KloudKtrl/asset-service","description":"Handles uploading/downloading assets, as well as their metadata","fork":false,"url":"https://api.github.com/repos/KloudKtrl/asset-service","forks_url":"https://api.github.com/repos/KloudKtrl/asset-service/forks","keys_url":"https://api.github.com/repos/KloudKtrl/asset-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KloudKtrl/asset-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KloudKtrl/asset-service/teams","hooks_url":"https://api.github.com/repos/KloudKtrl/asset-service/hooks","issue_events_url":"https://api.github.com/repos/KloudKtrl/asset-service/issues/events{/number}","events_url":"https://api.github.com/repos/KloudKtrl/asset-service/events","assignees_url":"https://api.github.com/repos/KloudKtrl/asset-service/assignees{/user}","branches_url":"https://api.github.com/repos/KloudKtrl/asset-service/branches{/branch}","tags_url":"https://api.github.com/repos/KloudKtrl/asset-service/tags","blobs_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KloudKtrl/asset-service/statuses/{sha}","languages_url":"https://api.github.com/repos/KloudKtrl/asset-service/languages","stargazers_url":"https://api.github.com/repos/KloudKtrl/asset-service/stargazers","contributors_url":"https://api.github.com/repos/KloudKtrl/asset-service/contributors","subscribers_url":"https://api.github.com/repos/KloudKtrl/asset-service/subscribers","subscription_url":"https://api.github.com/repos/KloudKtrl/asset-service/subscription","commits_url":"https://api.github.com/repos/KloudKtrl/asset-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/KloudKtrl/asset-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/KloudKtrl/asset-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/KloudKtrl/asset-service/contents/{+path}","compare_url":"https://api.github.com/repos/KloudKtrl/asset-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KloudKtrl/asset-service/merges","archive_url":"https://api.github.com/repos/KloudKtrl/asset-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KloudKtrl/asset-service/downloads","issues_url":"https://api.github.com/repos/KloudKtrl/asset-service/issues{/number}","pulls_url":"https://api.github.com/repos/KloudKtrl/asset-service/pulls{/number}","milestones_url":"https://api.github.com/repos/KloudKtrl/asset-service/milestones{/number}","notifications_url":"https://api.github.com/repos/KloudKtrl/asset-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KloudKtrl/asset-service/labels{/name}","releases_url":"https://api.github.com/repos/KloudKtrl/asset-service/releases{/id}","deployments_url":"https://api.github.com/repos/KloudKtrl/asset-service/deployments","created_at":"2016-08-15T20:35:34Z","updated_at":"2016-08-17T00:10:27Z","pushed_at":"2016-08-19T00:11:16Z","git_url":"git://github.com/KloudKtrl/asset-service.git","ssh_url":"git@github.com:KloudKtrl/asset-service.git","clone_url":"https://github.com/KloudKtrl/asset-service.git","svn_url":"https://github.com/KloudKtrl/asset-service","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"KloudKtrl:master","ref":"master","sha":"ebdf2d66a9bf9846e8da9c06fb4d8c6961186881","user":{"login":"KloudKtrl","id":18446918,"avatar_url":"https://avatars.githubusercontent.com/u/18446918?v=3","gravatar_id":"","url":"https://api.github.com/users/KloudKtrl","html_url":"https://github.com/KloudKtrl","followers_url":"https://api.github.com/users/KloudKtrl/followers","following_url":"https://api.github.com/users/KloudKtrl/following{/other_user}","gists_url":"https://api.github.com/users/KloudKtrl/gists{/gist_id}","starred_url":"https://api.github.com/users/KloudKtrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KloudKtrl/subscriptions","organizations_url":"https://api.github.com/users/KloudKtrl/orgs","repos_url":"https://api.github.com/users/KloudKtrl/repos","events_url":"https://api.github.com/users/KloudKtrl/events{/privacy}","received_events_url":"https://api.github.com/users/KloudKtrl/received_events","type":"Organization","site_admin":false},"repo":{"id":65763239,"name":"asset-service","full_name":"KloudKtrl/asset-service","owner":{"login":"KloudKtrl","id":18446918,"avatar_url":"https://avatars.githubusercontent.com/u/18446918?v=3","gravatar_id":"","url":"https://api.github.com/users/KloudKtrl","html_url":"https://github.com/KloudKtrl","followers_url":"https://api.github.com/users/KloudKtrl/followers","following_url":"https://api.github.com/users/KloudKtrl/following{/other_user}","gists_url":"https://api.github.com/users/KloudKtrl/gists{/gist_id}","starred_url":"https://api.github.com/users/KloudKtrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KloudKtrl/subscriptions","organizations_url":"https://api.github.com/users/KloudKtrl/orgs","repos_url":"https://api.github.com/users/KloudKtrl/repos","events_url":"https://api.github.com/users/KloudKtrl/events{/privacy}","received_events_url":"https://api.github.com/users/KloudKtrl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KloudKtrl/asset-service","description":"Handles uploading/downloading assets, as well as their metadata","fork":false,"url":"https://api.github.com/repos/KloudKtrl/asset-service","forks_url":"https://api.github.com/repos/KloudKtrl/asset-service/forks","keys_url":"https://api.github.com/repos/KloudKtrl/asset-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KloudKtrl/asset-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KloudKtrl/asset-service/teams","hooks_url":"https://api.github.com/repos/KloudKtrl/asset-service/hooks","issue_events_url":"https://api.github.com/repos/KloudKtrl/asset-service/issues/events{/number}","events_url":"https://api.github.com/repos/KloudKtrl/asset-service/events","assignees_url":"https://api.github.com/repos/KloudKtrl/asset-service/assignees{/user}","branches_url":"https://api.github.com/repos/KloudKtrl/asset-service/branches{/branch}","tags_url":"https://api.github.com/repos/KloudKtrl/asset-service/tags","blobs_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KloudKtrl/asset-service/statuses/{sha}","languages_url":"https://api.github.com/repos/KloudKtrl/asset-service/languages","stargazers_url":"https://api.github.com/repos/KloudKtrl/asset-service/stargazers","contributors_url":"https://api.github.com/repos/KloudKtrl/asset-service/contributors","subscribers_url":"https://api.github.com/repos/KloudKtrl/asset-service/subscribers","subscription_url":"https://api.github.com/repos/KloudKtrl/asset-service/subscription","commits_url":"https://api.github.com/repos/KloudKtrl/asset-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/KloudKtrl/asset-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/KloudKtrl/asset-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/KloudKtrl/asset-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/KloudKtrl/asset-service/contents/{+path}","compare_url":"https://api.github.com/repos/KloudKtrl/asset-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KloudKtrl/asset-service/merges","archive_url":"https://api.github.com/repos/KloudKtrl/asset-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KloudKtrl/asset-service/downloads","issues_url":"https://api.github.com/repos/KloudKtrl/asset-service/issues{/number}","pulls_url":"https://api.github.com/repos/KloudKtrl/asset-service/pulls{/number}","milestones_url":"https://api.github.com/repos/KloudKtrl/asset-service/milestones{/number}","notifications_url":"https://api.github.com/repos/KloudKtrl/asset-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KloudKtrl/asset-service/labels{/name}","releases_url":"https://api.github.com/repos/KloudKtrl/asset-service/releases{/id}","deployments_url":"https://api.github.com/repos/KloudKtrl/asset-service/deployments","created_at":"2016-08-15T20:35:34Z","updated_at":"2016-08-17T00:10:27Z","pushed_at":"2016-08-19T00:11:16Z","git_url":"git://github.com/KloudKtrl/asset-service.git","ssh_url":"git@github.com:KloudKtrl/asset-service.git","clone_url":"https://github.com/KloudKtrl/asset-service.git","svn_url":"https://github.com/KloudKtrl/asset-service","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/3"},"html":{"href":"https://github.com/KloudKtrl/asset-service/pull/3"},"issue":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/issues/3"},"comments":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/KloudKtrl/asset-service/statuses/459368ba73a45483dfe484a3bce0e5607b8d5a91"}}}}
{"actor":{"display_login":"houndci-bot"}}