GitHub PullRequestReviewCommentEvent at 2014-11-13 10:34:18
Repository: gophercloud
Actor: jamiehannaford
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/rackspace/gophercloud/pulls/comments/20282604","id":20282604,"diff_hunk":"@@ -0,0 +1,377 @@\n+package lbs\n+\n+import (\n+\t\"github.com/mitchellh/mapstructure\"\n+\n+\t\"github.com/rackspace/gophercloud\"\n+\t\"github.com/rackspace/gophercloud/pagination\"\n+\t\"github.com/rackspace/gophercloud/rackspace/lb/v1/acl\"\n+\t\"github.com/rackspace/gophercloud/rackspace/lb/v1/nodes\"\n+\t\"github.com/rackspace/gophercloud/rackspace/lb/v1/sessions\"\n+\t\"github.com/rackspace/gophercloud/rackspace/lb/v1/throttle\"\n+\t\"github.com/rackspace/gophercloud/rackspace/lb/v1/vips\"\n+)\n+\n+// Protocol represents the network protocol which the load balancer accepts.\n+type Protocol struct {\n+\t// The name of the protocol, e.g. HTTP, LDAP, FTP, etc.\n+\tName string\n+\n+\t// The port number for the protocol.\n+\tPort int\n+}\n+\n+// Algorithm defines how traffic should be directed between back-end nodes.\n+type Algorithm struct {\n+\t// The name of the algorithm, e.g RANDOM, ROUND_ROBIN, etc.\n+\tName string\n+}\n+\n+// Status represents the potential state of a load balancer resource.\n+type Status string\n+\n+const (\n+\t// ACTIVE indicates that the LB is configured properly and ready to serve\n+\t// traffic to incoming requests via the configured virtual IPs.\n+\tACTIVE = \"ACTIVE\"\n+\n+\t// BUILD indicates that the LB is being provisioned for the first time and\n+\t// configuration is being applied to bring the service online. The service\n+\t// cannot yet serve incoming requests.\n+\tBUILD = \"BUILD\"\n+\n+\t// PENDINGUPDATE indicates that the LB is online but configuration changes\n+\t// are being applied to update the service based on a previous request.\n+\tPENDINGUPDATE = \"PENDING_UPDATE\"\n+\n+\t// PENDINGDELETE indicates that the LB is online but configuration changes\n+\t// are being applied to begin deletion of the service based on a previous\n+\t// request.\n+\tPENDINGDELETE = \"PENDING_DELETE\"\n+\n+\t// SUSPENDED indicates that the LB has been taken offline and disabled.\n+\tSUSPENDED = \"SUSPENDED\"\n+\n+\t// ERROR indicates that the system encountered an error when attempting to\n+\t// configure the load balancer.\n+\tERROR = \"ERROR\"\n+\n+\t// DELETED indicates that the LB has been deleted.\n+\tDELETED = \"DELETED\"\n+)\n+\n+// Datetime represents the structure of a Created or Updated field.\n+type Datetime struct {\n+\tTime string","path":"rackspace/lb/v1/lbs/results.go","position":65,"original_position":65,"commit_id":"227d959073cd3eff12cfd898c1b12eee9461bd5e","original_commit_id":"a307e04ffa10b1812b920dcaf237a16a0c7da605","user":{"login":"jamiehannaford","id":1867202,"avatar_url":"https://avatars.githubusercontent.com/u/1867202?v=3","gravatar_id":"","url":"https://api.github.com/users/jamiehannaford","html_url":"https://github.com/jamiehannaford","followers_url":"https://api.github.com/users/jamiehannaford/followers","following_url":"https://api.github.com/users/jamiehannaford/following{/other_user}","gists_url":"https://api.github.com/users/jamiehannaford/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiehannaford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiehannaford/subscriptions","organizations_url":"https://api.github.com/users/jamiehannaford/orgs","repos_url":"https://api.github.com/users/jamiehannaford/repos","events_url":"https://api.github.com/users/jamiehannaford/events{/privacy}","received_events_url":"https://api.github.com/users/jamiehannaford/received_events","type":"User","site_admin":false},"body":"@jrperritt I've been playing around with and can't find an elegant solution. The problem is that `mapstructure` _needs_ a string type on the main `LoadBalancer` struct to be set so that it can convert the JSON. It can't convert JSON automatically into a `time.Time` time. And if you intercept the JSON, convert the string into a `time.Time` before the rest gets deserialized, it also complains.\r\n\r\nThe only option I can see is to have two fields: `Datetime.TimeStr` and `Datetime.TimeObj` that represent both forms - what do you think?","created_at":"2014-11-13T10:34:18Z","updated_at":"2014-11-13T10:34:18Z","html_url":"https://github.com/rackspace/gophercloud/pull/294#discussion_r20282604","pull_request_url":"https://api.github.com/repos/rackspace/gophercloud/pulls/294","_links":{"self":{"href":"https://api.github.com/repos/rackspace/gophercloud/pulls/comments/20282604"},"html":{"href":"https://github.com/rackspace/gophercloud/pull/294#discussion_r20282604"},"pull_request":{"href":"https://api.github.com/repos/rackspace/gophercloud/pulls/294"}}},"pull_request":{"url":"https://api.github.com/repos/rackspace/gophercloud/pulls/294","id":23686643,"html_url":"https://github.com/rackspace/gophercloud/pull/294","diff_url":"https://github.com/rackspace/gophercloud/pull/294.diff","patch_url":"https://github.com/rackspace/gophercloud/pull/294.patch","issue_url":"https://api.github.com/repos/rackspace/gophercloud/issues/294","number":294,"state":"open","locked":false,"title":"Rackspace CLBs","user":{"login":"jamiehannaford","id":1867202,"avatar_url":"https://avatars.githubusercontent.com/u/1867202?v=3","gravatar_id":"","url":"https://api.github.com/users/jamiehannaford","html_url":"https://github.com/jamiehannaford","followers_url":"https://api.github.com/users/jamiehannaford/followers","following_url":"https://api.github.com/users/jamiehannaford/following{/other_user}","gists_url":"https://api.github.com/users/jamiehannaford/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiehannaford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiehannaford/subscriptions","organizations_url":"https://api.github.com/users/jamiehannaford/orgs","repos_url":"https://api.github.com/users/jamiehannaford/repos","events_url":"https://api.github.com/users/jamiehannaford/events{/privacy}","received_events_url":"https://api.github.com/users/jamiehannaford/received_events","type":"User","site_admin":false},"body":"Addresses #289. Milestones are:\r\n\r\n- [x] LBs\r\n- [x] error pages\r\n- [x] LB stats\r\n- [x] nodes\r\n- [x] VIPs\r\n- [ ] domains\r\n- [ ] usage reports\r\n- [x] access lists\r\n- [x] monitors\r\n- [x] session persistence\r\n- [x] connection logging\r\n- [x] throttling\r\n- [ ] caching\r\n- [x] protocols\r\n- [x] algorithms\r\n- [x] SSL termination\r\n- [ ] metadata\r\n\r\n(Not sure if all of these resources will make it into this PR)","created_at":"2014-10-31T16:05:17Z","updated_at":"2014-11-13T10:34:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae0f40166f95c4b8fe840dd86e010248d7b80fbe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackspace/gophercloud/pulls/294/commits","review_comments_url":"https://api.github.com/repos/rackspace/gophercloud/pulls/294/comments","review_comment_url":"https://api.github.com/repos/rackspace/gophercloud/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rackspace/gophercloud/issues/294/comments","statuses_url":"https://api.github.com/repos/rackspace/gophercloud/statuses/227d959073cd3eff12cfd898c1b12eee9461bd5e","head":{"label":"jamiehannaford:rs-clb","ref":"rs-clb","sha":"227d959073cd3eff12cfd898c1b12eee9461bd5e","user":{"login":"jamiehannaford","id":1867202,"avatar_url":"https://avatars.githubusercontent.com/u/1867202?v=3","gravatar_id":"","url":"https://api.github.com/users/jamiehannaford","html_url":"https://github.com/jamiehannaford","followers_url":"https://api.github.com/users/jamiehannaford/followers","following_url":"https://api.github.com/users/jamiehannaford/following{/other_user}","gists_url":"https://api.github.com/users/jamiehannaford/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiehannaford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiehannaford/subscriptions","organizations_url":"https://api.github.com/users/jamiehannaford/orgs","repos_url":"https://api.github.com/users/jamiehannaford/repos","events_url":"https://api.github.com/users/jamiehannaford/events{/privacy}","received_events_url":"https://api.github.com/users/jamiehannaford/received_events","type":"User","site_admin":false},"repo":{"id":12089933,"name":"gophercloud","full_name":"jamiehannaford/gophercloud","owner":{"login":"jamiehannaford","id":1867202,"avatar_url":"https://avatars.githubusercontent.com/u/1867202?v=3","gravatar_id":"","url":"https://api.github.com/users/jamiehannaford","html_url":"https://github.com/jamiehannaford","followers_url":"https://api.github.com/users/jamiehannaford/followers","following_url":"https://api.github.com/users/jamiehannaford/following{/other_user}","gists_url":"https://api.github.com/users/jamiehannaford/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiehannaford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiehannaford/subscriptions","organizations_url":"https://api.github.com/users/jamiehannaford/orgs","repos_url":"https://api.github.com/users/jamiehannaford/repos","events_url":"https://api.github.com/users/jamiehannaford/events{/privacy}","received_events_url":"https://api.github.com/users/jamiehannaford/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jamiehannaford/gophercloud","description":"A multi-cloud language binding for Go","fork":true,"url":"https://api.github.com/repos/jamiehannaford/gophercloud","forks_url":"https://api.github.com/repos/jamiehannaford/gophercloud/forks","keys_url":"https://api.github.com/repos/jamiehannaford/gophercloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jamiehannaford/gophercloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jamiehannaford/gophercloud/teams","hooks_url":"https://api.github.com/repos/jamiehannaford/gophercloud/hooks","issue_events_url":"https://api.github.com/repos/jamiehannaford/gophercloud/issues/events{/number}","events_url":"https://api.github.com/repos/jamiehannaford/gophercloud/events","assignees_url":"https://api.github.com/repos/jamiehannaford/gophercloud/assignees{/user}","branches_url":"https://api.github.com/repos/jamiehannaford/gophercloud/branches{/branch}","tags_url":"https://api.github.com/repos/jamiehannaford/gophercloud/tags","blobs_url":"https://api.github.com/repos/jamiehannaford/gophercloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jamiehannaford/gophercloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jamiehannaford/gophercloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/jamiehannaford/gophercloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jamiehannaford/gophercloud/statuses/{sha}","languages_url":"https://api.github.com/repos/jamiehannaford/gophercloud/languages","stargazers_url":"https://api.github.com/repos/jamiehannaford/gophercloud/stargazers","contributors_url":"https://api.github.com/repos/jamiehannaford/gophercloud/contributors","subscribers_url":"https://api.github.com/repos/jamiehannaford/gophercloud/subscribers","subscription_url":"https://api.github.com/repos/jamiehannaford/gophercloud/subscription","commits_url":"https://api.github.com/repos/jamiehannaford/gophercloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/jamiehannaford/gophercloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/jamiehannaford/gophercloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/jamiehannaford/gophercloud/issues/comments/{number}","contents_url":"https://api.github.com/repos/jamiehannaford/gophercloud/contents/{+path}","compare_url":"https://api.github.com/repos/jamiehannaford/gophercloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jamiehannaford/gophercloud/merges","archive_url":"https://api.github.com/repos/jamiehannaford/gophercloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jamiehannaford/gophercloud/downloads","issues_url":"https://api.github.com/repos/jamiehannaford/gophercloud/issues{/number}","pulls_url":"https://api.github.com/repos/jamiehannaford/gophercloud/pulls{/number}","milestones_url":"https://api.github.com/repos/jamiehannaford/gophercloud/milestones{/number}","notifications_url":"https://api.github.com/repos/jamiehannaford/gophercloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jamiehannaford/gophercloud/labels{/name}","releases_url":"https://api.github.com/repos/jamiehannaford/gophercloud/releases{/id}","created_at":"2013-08-13T18:59:02Z","updated_at":"2014-09-09T14:39:21Z","pushed_at":"2014-11-13T09:32:18Z","git_url":"git://github.com/jamiehannaford/gophercloud.git","ssh_url":"git@github.com:jamiehannaford/gophercloud.git","clone_url":"https://github.com/jamiehannaford/gophercloud.git","svn_url":"https://github.com/jamiehannaford/gophercloud","homepage":null,"size":9138,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rackspace:master","ref":"master","sha":"81608d3fc83c6977e4953c95353907a6fc6af28e","user":{"login":"rackspace","id":3949923,"avatar_url":"https://avatars.githubusercontent.com/u/3949923?v=3","gravatar_id":"","url":"https://api.github.com/users/rackspace","html_url":"https://github.com/rackspace","followers_url":"https://api.github.com/users/rackspace/followers","following_url":"https://api.github.com/users/rackspace/following{/other_user}","gists_url":"https://api.github.com/users/rackspace/gists{/gist_id}","starred_url":"https://api.github.com/users/rackspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackspace/subscriptions","organizations_url":"https://api.github.com/users/rackspace/orgs","repos_url":"https://api.github.com/users/rackspace/repos","events_url":"https://api.github.com/users/rackspace/events{/privacy}","received_events_url":"https://api.github.com/users/rackspace/received_events","type":"Organization","site_admin":false},"repo":{"id":10826219,"name":"gophercloud","full_name":"rackspace/gophercloud","owner":{"login":"rackspace","id":3949923,"avatar_url":"https://avatars.githubusercontent.com/u/3949923?v=3","gravatar_id":"","url":"https://api.github.com/users/rackspace","html_url":"https://github.com/rackspace","followers_url":"https://api.github.com/users/rackspace/followers","following_url":"https://api.github.com/users/rackspace/following{/other_user}","gists_url":"https://api.github.com/users/rackspace/gists{/gist_id}","starred_url":"https://api.github.com/users/rackspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackspace/subscriptions","organizations_url":"https://api.github.com/users/rackspace/orgs","repos_url":"https://api.github.com/users/rackspace/repos","events_url":"https://api.github.com/users/rackspace/events{/privacy}","received_events_url":"https://api.github.com/users/rackspace/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackspace/gophercloud","description":"The Go SDK for Openstack.","fork":false,"url":"https://api.github.com/repos/rackspace/gophercloud","forks_url":"https://api.github.com/repos/rackspace/gophercloud/forks","keys_url":"https://api.github.com/repos/rackspace/gophercloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackspace/gophercloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackspace/gophercloud/teams","hooks_url":"https://api.github.com/repos/rackspace/gophercloud/hooks","issue_events_url":"https://api.github.com/repos/rackspace/gophercloud/issues/events{/number}","events_url":"https://api.github.com/repos/rackspace/gophercloud/events","assignees_url":"https://api.github.com/repos/rackspace/gophercloud/assignees{/user}","branches_url":"https://api.github.com/repos/rackspace/gophercloud/branches{/branch}","tags_url":"https://api.github.com/repos/rackspace/gophercloud/tags","blobs_url":"https://api.github.com/repos/rackspace/gophercloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackspace/gophercloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackspace/gophercloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackspace/gophercloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackspace/gophercloud/statuses/{sha}","languages_url":"https://api.github.com/repos/rackspace/gophercloud/languages","stargazers_url":"https://api.github.com/repos/rackspace/gophercloud/stargazers","contributors_url":"https://api.github.com/repos/rackspace/gophercloud/contributors","subscribers_url":"https://api.github.com/repos/rackspace/gophercloud/subscribers","subscription_url":"https://api.github.com/repos/rackspace/gophercloud/subscription","commits_url":"https://api.github.com/repos/rackspace/gophercloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackspace/gophercloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackspace/gophercloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackspace/gophercloud/issues/comments/{number}","contents_url":"https://api.github.com/repos/rackspace/gophercloud/contents/{+path}","compare_url":"https://api.github.com/repos/rackspace/gophercloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackspace/gophercloud/merges","archive_url":"https://api.github.com/repos/rackspace/gophercloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackspace/gophercloud/downloads","issues_url":"https://api.github.com/repos/rackspace/gophercloud/issues{/number}","pulls_url":"https://api.github.com/repos/rackspace/gophercloud/pulls{/number}","milestones_url":"https://api.github.com/repos/rackspace/gophercloud/milestones{/number}","notifications_url":"https://api.github.com/repos/rackspace/gophercloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackspace/gophercloud/labels{/name}","releases_url":"https://api.github.com/repos/rackspace/gophercloud/releases{/id}","created_at":"2013-06-20T18:10:46Z","updated_at":"2014-11-08T01:42:13Z","pushed_at":"2014-11-10T12:58:52Z","git_url":"git://github.com/rackspace/gophercloud.git","ssh_url":"git@github.com:rackspace/gophercloud.git","clone_url":"https://github.com/rackspace/gophercloud.git","svn_url":"https://github.com/rackspace/gophercloud","homepage":"gophercloud.io","size":12420,"stargazers_count":237,"watchers_count":237,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":41,"mirror_url":null,"open_issues_count":30,"forks":41,"open_issues":30,"watchers":237,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackspace/gophercloud/pulls/294"},"html":{"href":"https://github.com/rackspace/gophercloud/pull/294"},"issue":{"href":"https://api.github.com/repos/rackspace/gophercloud/issues/294"},"comments":{"href":"https://api.github.com/repos/rackspace/gophercloud/issues/294/comments"},"review_comments":{"href":"https://api.github.com/repos/rackspace/gophercloud/pulls/294/comments"},"review_comment":{"href":"https://api.github.com/repos/rackspace/gophercloud/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rackspace/gophercloud/pulls/294/commits"},"statuses":{"href":"https://api.github.com/repos/rackspace/gophercloud/statuses/227d959073cd3eff12cfd898c1b12eee9461bd5e"}}}}