{"action":"created","comment":{"url":"https://api.github.com/repos/nyaruka/goflow/pulls/comments/173442315","pull_request_review_id":102636241,"id":173442315,"diff_hunk":"@@ -27,8 +28,78 @@ func ValidateURNScheme(fl validator.FieldLevel) bool {\n \treturn urns.IsValidScheme(fl.Field().String())\n }\n \n+type ContactURN struct {\n+\turns.URN\n+\tchannel Channel\n+}\n+\n+func (u *ContactURN) Channel() Channel { return u.channel }\n+\n+// Resolve is called when a URN is part of an excellent expression\n+func (u *ContactURN) Resolve(key string) interface{} {\n+\tswitch key {\n+\tcase \"scheme\":\n+\t\treturn u.URN.Scheme()\n+\tcase \"path\":\n+\t\treturn u.URN.Path()\n+\tcase \"display\":\n+\t\treturn u.URN.Display()\n+\tcase \"channel\":\n+\t\treturn u.Channel()\n+\t}\n+\treturn fmt.Errorf(\"no field '%s' on URN\", key)\n+}\n+\n+func (u *ContactURN) Default() interface{} { return u }\n+\n+func (u *ContactURN) String() string { return string(u.URN) }\n+\n // URNList is the list of a contact's URNs\n-type URNList []urns.URN\n+type URNList []*ContactURN","path":"flows/urns.go","position":49,"original_position":49,"commit_id":"dba4bdb23e59cfe61c687f299d184f3d016e5045","original_commit_id":"dba4bdb23e59cfe61c687f299d184f3d016e5045","user":{"login":"nicpottier","id":168067,"avatar_url":"https://avatars3.githubusercontent.com/u/168067?v=4","gravatar_id":"","url":"https://api.github.com/users/nicpottier","html_url":"https://github.com/nicpottier","followers_url":"https://api.github.com/users/nicpottier/followers","following_url":"https://api.github.com/users/nicpottier/following{/other_user}","gists_url":"https://api.github.com/users/nicpottier/gists{/gist_id}","starred_url":"https://api.github.com/users/nicpottier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicpottier/subscriptions","organizations_url":"https://api.github.com/users/nicpottier/orgs","repos_url":"https://api.github.com/users/nicpottier/repos","events_url":"https://api.github.com/users/nicpottier/events{/privacy}","received_events_url":"https://api.github.com/users/nicpottier/received_events","type":"User","site_admin":false},"body":"Why pointer?","created_at":"2018-03-09T12:56:24Z","updated_at":"2018-03-09T12:56:24Z","html_url":"https://github.com/nyaruka/goflow/pull/170#discussion_r173442315","pull_request_url":"https://api.github.com/repos/nyaruka/goflow/pulls/170","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/nyaruka/goflow/pulls/comments/173442315"},"html":{"href":"https://github.com/nyaruka/goflow/pull/170#discussion_r173442315"},"pull_request":{"href":"https://api.github.com/repos/nyaruka/goflow/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/nyaruka/goflow/pulls/170","id":173789869,"html_url":"https://github.com/nyaruka/goflow/pull/170","diff_url":"https://github.com/nyaruka/goflow/pull/170.diff","patch_url":"https://github.com/nyaruka/goflow/pull/170.patch","issue_url":"https://api.github.com/repos/nyaruka/goflow/issues/170","number":170,"state":"open","locked":false,"title":"Add support for URNs with channels as query params","user":{"login":"rowanseymour","id":675558,"avatar_url":"https://avatars0.githubusercontent.com/u/675558?v=4","gravatar_id":"","url":"https://api.github.com/users/rowanseymour","html_url":"https://github.com/rowanseymour","followers_url":"https://api.github.com/users/rowanseymour/followers","following_url":"https://api.github.com/users/rowanseymour/following{/other_user}","gists_url":"https://api.github.com/users/rowanseymour/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanseymour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanseymour/subscriptions","organizations_url":"https://api.github.com/users/rowanseymour/orgs","repos_url":"https://api.github.com/users/rowanseymour/repos","events_url":"https://api.github.com/users/rowanseymour/events{/privacy}","received_events_url":"https://api.github.com/users/rowanseymour/received_events","type":"User","site_admin":false},"body":"Introduces a `ContactURN` as a wrapper for URNs on a contact so we can extract their channel like https://github.com/nyaruka/goflow/compare/new_urns?expand=1#diff-488bb6c851b01295dc4960583fb229d8R38","created_at":"2018-03-08T16:51:07Z","updated_at":"2018-03-09T12:56:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8858b5e090d1bb7bc472275d17780bbac7dc495","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":816464658,"url":"https://api.github.com/repos/nyaruka/goflow/labels/review","name":"review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nyaruka/goflow/pulls/170/commits","review_comments_url":"https://api.github.com/repos/nyaruka/goflow/pulls/170/comments","review_comment_url":"https://api.github.com/repos/nyaruka/goflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nyaruka/goflow/issues/170/comments","statuses_url":"https://api.github.com/repos/nyaruka/goflow/statuses/dba4bdb23e59cfe61c687f299d184f3d016e5045","head":{"label":"nyaruka:new_urns","ref":"new_urns","sha":"dba4bdb23e59cfe61c687f299d184f3d016e5045","user":{"login":"nyaruka","id":299256,"avatar_url":"https://avatars0.githubusercontent.com/u/299256?v=4","gravatar_id":"","url":"https://api.github.com/users/nyaruka","html_url":"https://github.com/nyaruka","followers_url":"https://api.github.com/users/nyaruka/followers","following_url":"https://api.github.com/users/nyaruka/following{/other_user}","gists_url":"https://api.github.com/users/nyaruka/gists{/gist_id}","starred_url":"https://api.github.com/users/nyaruka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyaruka/subscriptions","organizations_url":"https://api.github.com/users/nyaruka/orgs","repos_url":"https://api.github.com/users/nyaruka/repos","events_url":"https://api.github.com/users/nyaruka/events{/privacy}","received_events_url":"https://api.github.com/users/nyaruka/received_events","type":"Organization","site_admin":false},"repo":{"id":90892160,"name":"goflow","full_name":"nyaruka/goflow","owner":{"login":"nyaruka","id":299256,"avatar_url":"https://avatars0.githubusercontent.com/u/299256?v=4","gravatar_id":"","url":"https://api.github.com/users/nyaruka","html_url":"https://github.com/nyaruka","followers_url":"https://api.github.com/users/nyaruka/followers","following_url":"https://api.github.com/users/nyaruka/following{/other_user}","gists_url":"https://api.github.com/users/nyaruka/gists{/gist_id}","starred_url":"https://api.github.com/users/nyaruka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyaruka/subscriptions","organizations_url":"https://api.github.com/users/nyaruka/orgs","repos_url":"https://api.github.com/users/nyaruka/repos","events_url":"https://api.github.com/users/nyaruka/events{/privacy}","received_events_url":"https://api.github.com/users/nyaruka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nyaruka/goflow","description":"Golang Flow Engine for RapidPro","fork":false,"url":"https://api.github.com/repos/nyaruka/goflow","forks_url":"https://api.github.com/repos/nyaruka/goflow/forks","keys_url":"https://api.github.com/repos/nyaruka/goflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyaruka/goflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyaruka/goflow/teams","hooks_url":"https://api.github.com/repos/nyaruka/goflow/hooks","issue_events_url":"https://api.github.com/repos/nyaruka/goflow/issues/events{/number}","events_url":"https://api.github.com/repos/nyaruka/goflow/events","assignees_url":"https://api.github.com/repos/nyaruka/goflow/assignees{/user}","branches_url":"https://api.github.com/repos/nyaruka/goflow/branches{/branch}","tags_url":"https://api.github.com/repos/nyaruka/goflow/tags","blobs_url":"https://api.github.com/repos/nyaruka/goflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyaruka/goflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyaruka/goflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyaruka/goflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyaruka/goflow/statuses/{sha}","languages_url":"https://api.github.com/repos/nyaruka/goflow/languages","stargazers_url":"https://api.github.com/repos/nyaruka/goflow/stargazers","contributors_url":"https://api.github.com/repos/nyaruka/goflow/contributors","subscribers_url":"https://api.github.com/repos/nyaruka/goflow/subscribers","subscription_url":"https://api.github.com/repos/nyaruka/goflow/subscription","commits_url":"https://api.github.com/repos/nyaruka/goflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyaruka/goflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyaruka/goflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyaruka/goflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyaruka/goflow/contents/{+path}","compare_url":"https://api.github.com/repos/nyaruka/goflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyaruka/goflow/merges","archive_url":"https://api.github.com/repos/nyaruka/goflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyaruka/goflow/downloads","issues_url":"https://api.github.com/repos/nyaruka/goflow/issues{/number}","pulls_url":"https://api.github.com/repos/nyaruka/goflow/pulls{/number}","milestones_url":"https://api.github.com/repos/nyaruka/goflow/milestones{/number}","notifications_url":"https://api.github.com/repos/nyaruka/goflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyaruka/goflow/labels{/name}","releases_url":"https://api.github.com/repos/nyaruka/goflow/releases{/id}","deployments_url":"https://api.github.com/repos/nyaruka/goflow/deployments","created_at":"2017-05-10T17:43:06Z","updated_at":"2018-01-25T13:36:48Z","pushed_at":"2018-03-08T20:52:29Z","git_url":"git://github.com/nyaruka/goflow.git","ssh_url":"git@github.com:nyaruka/goflow.git","clone_url":"https://github.com/nyaruka/goflow.git","svn_url":"https://github.com/nyaruka/goflow","homepage":"","size":9748,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":2,"open_issues":36,"watchers":6,"default_branch":"master"}},"base":{"label":"nyaruka:master","ref":"master","sha":"43b86ea46b4e43a831fb4dc38de23ade0b8689ca","user":{"login":"nyaruka","id":299256,"avatar_url":"https://avatars0.githubusercontent.com/u/299256?v=4","gravatar_id":"","url":"https://api.github.com/users/nyaruka","html_url":"https://github.com/nyaruka","followers_url":"https://api.github.com/users/nyaruka/followers","following_url":"https://api.github.com/users/nyaruka/following{/other_user}","gists_url":"https://api.github.com/users/nyaruka/gists{/gist_id}","starred_url":"https://api.github.com/users/nyaruka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyaruka/subscriptions","organizations_url":"https://api.github.com/users/nyaruka/orgs","repos_url":"https://api.github.com/users/nyaruka/repos","events_url":"https://api.github.com/users/nyaruka/events{/privacy}","received_events_url":"https://api.github.com/users/nyaruka/received_events","type":"Organization","site_admin":false},"repo":{"id":90892160,"name":"goflow","full_name":"nyaruka/goflow","owner":{"login":"nyaruka","id":299256,"avatar_url":"https://avatars0.githubusercontent.com/u/299256?v=4","gravatar_id":"","url":"https://api.github.com/users/nyaruka","html_url":"https://github.com/nyaruka","followers_url":"https://api.github.com/users/nyaruka/followers","following_url":"https://api.github.com/users/nyaruka/following{/other_user}","gists_url":"https://api.github.com/users/nyaruka/gists{/gist_id}","starred_url":"https://api.github.com/users/nyaruka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyaruka/subscriptions","organizations_url":"https://api.github.com/users/nyaruka/orgs","repos_url":"https://api.github.com/users/nyaruka/repos","events_url":"https://api.github.com/users/nyaruka/events{/privacy}","received_events_url":"https://api.github.com/users/nyaruka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nyaruka/goflow","description":"Golang Flow Engine for RapidPro","fork":false,"url":"https://api.github.com/repos/nyaruka/goflow","forks_url":"https://api.github.com/repos/nyaruka/goflow/forks","keys_url":"https://api.github.com/repos/nyaruka/goflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyaruka/goflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyaruka/goflow/teams","hooks_url":"https://api.github.com/repos/nyaruka/goflow/hooks","issue_events_url":"https://api.github.com/repos/nyaruka/goflow/issues/events{/number}","events_url":"https://api.github.com/repos/nyaruka/goflow/events","assignees_url":"https://api.github.com/repos/nyaruka/goflow/assignees{/user}","branches_url":"https://api.github.com/repos/nyaruka/goflow/branches{/branch}","tags_url":"https://api.github.com/repos/nyaruka/goflow/tags","blobs_url":"https://api.github.com/repos/nyaruka/goflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyaruka/goflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyaruka/goflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyaruka/goflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyaruka/goflow/statuses/{sha}","languages_url":"https://api.github.com/repos/nyaruka/goflow/languages","stargazers_url":"https://api.github.com/repos/nyaruka/goflow/stargazers","contributors_url":"https://api.github.com/repos/nyaruka/goflow/contributors","subscribers_url":"https://api.github.com/repos/nyaruka/goflow/subscribers","subscription_url":"https://api.github.com/repos/nyaruka/goflow/subscription","commits_url":"https://api.github.com/repos/nyaruka/goflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyaruka/goflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyaruka/goflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyaruka/goflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyaruka/goflow/contents/{+path}","compare_url":"https://api.github.com/repos/nyaruka/goflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyaruka/goflow/merges","archive_url":"https://api.github.com/repos/nyaruka/goflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyaruka/goflow/downloads","issues_url":"https://api.github.com/repos/nyaruka/goflow/issues{/number}","pulls_url":"https://api.github.com/repos/nyaruka/goflow/pulls{/number}","milestones_url":"https://api.github.com/repos/nyaruka/goflow/milestones{/number}","notifications_url":"https://api.github.com/repos/nyaruka/goflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyaruka/goflow/labels{/name}","releases_url":"https://api.github.com/repos/nyaruka/goflow/releases{/id}","deployments_url":"https://api.github.com/repos/nyaruka/goflow/deployments","created_at":"2017-05-10T17:43:06Z","updated_at":"2018-01-25T13:36:48Z","pushed_at":"2018-03-08T20:52:29Z","git_url":"git://github.com/nyaruka/goflow.git","ssh_url":"git@github.com:nyaruka/goflow.git","clone_url":"https://github.com/nyaruka/goflow.git","svn_url":"https://github.com/nyaruka/goflow","homepage":"","size":9748,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":2,"open_issues":36,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nyaruka/goflow/pulls/170"},"html":{"href":"https://github.com/nyaruka/goflow/pull/170"},"issue":{"href":"https://api.github.com/repos/nyaruka/goflow/issues/170"},"comments":{"href":"https://api.github.com/repos/nyaruka/goflow/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/nyaruka/goflow/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/nyaruka/goflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nyaruka/goflow/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/nyaruka/goflow/statuses/dba4bdb23e59cfe61c687f299d184f3d016e5045"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nicpottier"}}