{"action":"created","comment":{"url":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/comments/236818434","pull_request_review_id":178973420,"id":236818434,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjgxODQzNA==","diff_hunk":"@@ -0,0 +1,74 @@\n+// Copyright (c) OpenFaaS Project 2018. All rights reserved.\n+// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n+package config\n+\n+import (\n+\t\"log\"\n+\t\"os\"\n+\t\"strings\"\n+\t\"time\"\n+)\n+\n+type Config struct {\n+\tGatewayURL      string\n+\tUpstreamTimeout time.Duration\n+\tTopics          []string\n+\tPrintResponse   bool\n+\tRebuildInterval time.Duration\n+\tBroker          string\n+}\n+\n+func Get() Config {\n+\tbroker := \"nats\"\n+\tif val, exists := os.LookupEnv(\"broker_host\"); exists {\n+\t\tbroker = val\n+\t}\n+\n+\ttopics := []string{}\n+\tif val, exists := os.LookupEnv(\"topics\"); exists {\n+\t\tfor _, topic := range strings.Split(val, \",\") {\n+\t\t\tif len(topic) > 0 {\n+\t\t\t\ttopics = append(topics, topic)\n+\t\t\t}\n+\t\t}\n+\t}\n+\tif len(topics) == 0 {\n+\t\tlog.Fatal(`Provide a list of topics i.e. topics=\"payment_published,slack_joined\"`)\n+\t}\n+\n+\tgatewayURL := \"http://gateway:8080\"\n+\tif val, exists := os.LookupEnv(\"gateway_url\"); exists {\n+\t\tgatewayURL = val\n+\t}\n+\n+\tupstreamTimeout := time.Second * 30\n+\trebuildInterval := time.Second * 3\n+\n+\tif val, exists := os.LookupEnv(\"upstream_timeout\"); exists {\n+\t\tparsedVal, err := time.ParseDuration(val)\n+\t\tif err == nil {\n+\t\t\tupstreamTimeout = parsedVal\n+\t\t}\n+\t}\n+\n+\tif val, exists := os.LookupEnv(\"rebuild_interval\"); exists {\n+\t\tparsedVal, err := time.ParseDuration(val)\n+\t\tif err == nil {\n+\t\t\trebuildInterval = parsedVal\n+\t\t}\n+\t}\n+\n+\tprintResponse := false\n+\tif val, exists := os.LookupEnv(\"print_response\"); exists {\n+\t\tprintResponse = (val == \"1\" || val == \"true\")\n+\t}\n+\n+\treturn Config{\n+\t\tGatewayURL:      gatewayURL,\n+\t\tUpstreamTimeout: upstreamTimeout,\n+\t\tTopics:          topics,\n+\t\tRebuildInterval: rebuildInterval,\n+\t\tBroker:          broker,\n+\t\tPrintResponse:   printResponse,\n+\t}\n+}","path":"config/config.go","position":74,"original_position":74,"commit_id":"18173eb0d9166aab8a72cf22dc67efeb4569ca83","original_commit_id":"18173eb0d9166aab8a72cf22dc67efeb4569ca83","user":{"login":"alexellis","id":6358735,"node_id":"MDQ6VXNlcjYzNTg3MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/6358735?v=4","gravatar_id":"","url":"https://api.github.com/users/alexellis","html_url":"https://github.com/alexellis","followers_url":"https://api.github.com/users/alexellis/followers","following_url":"https://api.github.com/users/alexellis/following{/other_user}","gists_url":"https://api.github.com/users/alexellis/gists{/gist_id}","starred_url":"https://api.github.com/users/alexellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexellis/subscriptions","organizations_url":"https://api.github.com/users/alexellis/orgs","repos_url":"https://api.github.com/users/alexellis/repos","events_url":"https://api.github.com/users/alexellis/events{/privacy}","received_events_url":"https://api.github.com/users/alexellis/received_events","type":"User","site_admin":false},"body":"How does go.mod etc work with using Go 1.9.2 in the dockerfile? Maybe dep would be better until everything else can move across?","created_at":"2018-11-27T19:43:35Z","updated_at":"2018-11-27T19:46:13Z","html_url":"https://github.com/openfaas-incubator/nats-connector/pull/1#discussion_r236818434","pull_request_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/1","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/comments/236818434"},"html":{"href":"https://github.com/openfaas-incubator/nats-connector/pull/1#discussion_r236818434"},"pull_request":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/1","id":233763793,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNzYzNzkz","html_url":"https://github.com/openfaas-incubator/nats-connector/pull/1","diff_url":"https://github.com/openfaas-incubator/nats-connector/pull/1.diff","patch_url":"https://github.com/openfaas-incubator/nats-connector/pull/1.patch","issue_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/issues/1","number":1,"state":"open","locked":false,"title":"Initial NATS Connector Implementation","user":{"login":"johnmccabe","id":83862,"node_id":"MDQ6VXNlcjgzODYy","avatar_url":"https://avatars3.githubusercontent.com/u/83862?v=4","gravatar_id":"","url":"https://api.github.com/users/johnmccabe","html_url":"https://github.com/johnmccabe","followers_url":"https://api.github.com/users/johnmccabe/followers","following_url":"https://api.github.com/users/johnmccabe/following{/other_user}","gists_url":"https://api.github.com/users/johnmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmccabe/subscriptions","organizations_url":"https://api.github.com/users/johnmccabe/orgs","repos_url":"https://api.github.com/users/johnmccabe/repos","events_url":"https://api.github.com/users/johnmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/johnmccabe/received_events","type":"User","site_admin":false},"body":"Raising for visibility, some tweaking/tidy-up required (k8s config, sample producer, multistage build, makefile etc)\r\n\r\nBuilt using `github.com/openfaas-incubator/connector-sdk`.","created_at":"2018-11-27T02:58:44Z","updated_at":"2018-11-27T19:46:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"716f015fcad854deeec4b02724e1aaacf511e95b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/1/commits","review_comments_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/1/comments","review_comment_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/issues/1/comments","statuses_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/statuses/18173eb0d9166aab8a72cf22dc67efeb4569ca83","head":{"label":"johnmccabe:nats","ref":"nats","sha":"18173eb0d9166aab8a72cf22dc67efeb4569ca83","user":{"login":"johnmccabe","id":83862,"node_id":"MDQ6VXNlcjgzODYy","avatar_url":"https://avatars3.githubusercontent.com/u/83862?v=4","gravatar_id":"","url":"https://api.github.com/users/johnmccabe","html_url":"https://github.com/johnmccabe","followers_url":"https://api.github.com/users/johnmccabe/followers","following_url":"https://api.github.com/users/johnmccabe/following{/other_user}","gists_url":"https://api.github.com/users/johnmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmccabe/subscriptions","organizations_url":"https://api.github.com/users/johnmccabe/orgs","repos_url":"https://api.github.com/users/johnmccabe/repos","events_url":"https://api.github.com/users/johnmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/johnmccabe/received_events","type":"User","site_admin":false},"repo":{"id":159266485,"node_id":"MDEwOlJlcG9zaXRvcnkxNTkyNjY0ODU=","name":"nats-connector","full_name":"johnmccabe/nats-connector","private":false,"owner":{"login":"johnmccabe","id":83862,"node_id":"MDQ6VXNlcjgzODYy","avatar_url":"https://avatars3.githubusercontent.com/u/83862?v=4","gravatar_id":"","url":"https://api.github.com/users/johnmccabe","html_url":"https://github.com/johnmccabe","followers_url":"https://api.github.com/users/johnmccabe/followers","following_url":"https://api.github.com/users/johnmccabe/following{/other_user}","gists_url":"https://api.github.com/users/johnmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmccabe/subscriptions","organizations_url":"https://api.github.com/users/johnmccabe/orgs","repos_url":"https://api.github.com/users/johnmccabe/repos","events_url":"https://api.github.com/users/johnmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/johnmccabe/received_events","type":"User","site_admin":false},"html_url":"https://github.com/johnmccabe/nats-connector","description":"[WIP] NATS event connector for OpenFaaS","fork":true,"url":"https://api.github.com/repos/johnmccabe/nats-connector","forks_url":"https://api.github.com/repos/johnmccabe/nats-connector/forks","keys_url":"https://api.github.com/repos/johnmccabe/nats-connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/johnmccabe/nats-connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/johnmccabe/nats-connector/teams","hooks_url":"https://api.github.com/repos/johnmccabe/nats-connector/hooks","issue_events_url":"https://api.github.com/repos/johnmccabe/nats-connector/issues/events{/number}","events_url":"https://api.github.com/repos/johnmccabe/nats-connector/events","assignees_url":"https://api.github.com/repos/johnmccabe/nats-connector/assignees{/user}","branches_url":"https://api.github.com/repos/johnmccabe/nats-connector/branches{/branch}","tags_url":"https://api.github.com/repos/johnmccabe/nats-connector/tags","blobs_url":"https://api.github.com/repos/johnmccabe/nats-connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/johnmccabe/nats-connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/johnmccabe/nats-connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/johnmccabe/nats-connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/johnmccabe/nats-connector/statuses/{sha}","languages_url":"https://api.github.com/repos/johnmccabe/nats-connector/languages","stargazers_url":"https://api.github.com/repos/johnmccabe/nats-connector/stargazers","contributors_url":"https://api.github.com/repos/johnmccabe/nats-connector/contributors","subscribers_url":"https://api.github.com/repos/johnmccabe/nats-connector/subscribers","subscription_url":"https://api.github.com/repos/johnmccabe/nats-connector/subscription","commits_url":"https://api.github.com/repos/johnmccabe/nats-connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/johnmccabe/nats-connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/johnmccabe/nats-connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/johnmccabe/nats-connector/issues/comments{/number}","contents_url":"https://api.github.com/repos/johnmccabe/nats-connector/contents/{+path}","compare_url":"https://api.github.com/repos/johnmccabe/nats-connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/johnmccabe/nats-connector/merges","archive_url":"https://api.github.com/repos/johnmccabe/nats-connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/johnmccabe/nats-connector/downloads","issues_url":"https://api.github.com/repos/johnmccabe/nats-connector/issues{/number}","pulls_url":"https://api.github.com/repos/johnmccabe/nats-connector/pulls{/number}","milestones_url":"https://api.github.com/repos/johnmccabe/nats-connector/milestones{/number}","notifications_url":"https://api.github.com/repos/johnmccabe/nats-connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/johnmccabe/nats-connector/labels{/name}","releases_url":"https://api.github.com/repos/johnmccabe/nats-connector/releases{/id}","deployments_url":"https://api.github.com/repos/johnmccabe/nats-connector/deployments","created_at":"2018-11-27T02:51:14Z","updated_at":"2018-11-27T02:51:16Z","pushed_at":"2018-11-27T03:18:16Z","git_url":"git://github.com/johnmccabe/nats-connector.git","ssh_url":"git@github.com:johnmccabe/nats-connector.git","clone_url":"https://github.com/johnmccabe/nats-connector.git","svn_url":"https://github.com/johnmccabe/nats-connector","homepage":null,"size":65,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openfaas-incubator:master","ref":"master","sha":"9c50071c3da9f88811048efeca92bcbcf07c367a","user":{"login":"openfaas-incubator","id":32622032,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjIyMDMy","avatar_url":"https://avatars3.githubusercontent.com/u/32622032?v=4","gravatar_id":"","url":"https://api.github.com/users/openfaas-incubator","html_url":"https://github.com/openfaas-incubator","followers_url":"https://api.github.com/users/openfaas-incubator/followers","following_url":"https://api.github.com/users/openfaas-incubator/following{/other_user}","gists_url":"https://api.github.com/users/openfaas-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/openfaas-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfaas-incubator/subscriptions","organizations_url":"https://api.github.com/users/openfaas-incubator/orgs","repos_url":"https://api.github.com/users/openfaas-incubator/repos","events_url":"https://api.github.com/users/openfaas-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/openfaas-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":158574940,"node_id":"MDEwOlJlcG9zaXRvcnkxNTg1NzQ5NDA=","name":"nats-connector","full_name":"openfaas-incubator/nats-connector","private":false,"owner":{"login":"openfaas-incubator","id":32622032,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjIyMDMy","avatar_url":"https://avatars3.githubusercontent.com/u/32622032?v=4","gravatar_id":"","url":"https://api.github.com/users/openfaas-incubator","html_url":"https://github.com/openfaas-incubator","followers_url":"https://api.github.com/users/openfaas-incubator/followers","following_url":"https://api.github.com/users/openfaas-incubator/following{/other_user}","gists_url":"https://api.github.com/users/openfaas-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/openfaas-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfaas-incubator/subscriptions","organizations_url":"https://api.github.com/users/openfaas-incubator/orgs","repos_url":"https://api.github.com/users/openfaas-incubator/repos","events_url":"https://api.github.com/users/openfaas-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/openfaas-incubator/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openfaas-incubator/nats-connector","description":"[WIP] NATS event connector for OpenFaaS","fork":false,"url":"https://api.github.com/repos/openfaas-incubator/nats-connector","forks_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/forks","keys_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/teams","hooks_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/hooks","issue_events_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/issues/events{/number}","events_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/events","assignees_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/assignees{/user}","branches_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/branches{/branch}","tags_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/tags","blobs_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/statuses/{sha}","languages_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/languages","stargazers_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/stargazers","contributors_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/contributors","subscribers_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/subscribers","subscription_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/subscription","commits_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/contents/{+path}","compare_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/merges","archive_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/downloads","issues_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/issues{/number}","pulls_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls{/number}","milestones_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/milestones{/number}","notifications_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/labels{/name}","releases_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/releases{/id}","deployments_url":"https://api.github.com/repos/openfaas-incubator/nats-connector/deployments","created_at":"2018-11-21T16:13:28Z","updated_at":"2018-11-22T09:40:53Z","pushed_at":"2018-11-27T03:18:17Z","git_url":"git://github.com/openfaas-incubator/nats-connector.git","ssh_url":"git@github.com:openfaas-incubator/nats-connector.git","clone_url":"https://github.com/openfaas-incubator/nats-connector.git","svn_url":"https://github.com/openfaas-incubator/nats-connector","homepage":null,"size":1,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/1"},"html":{"href":"https://github.com/openfaas-incubator/nats-connector/pull/1"},"issue":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/issues/1"},"comments":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/openfaas-incubator/nats-connector/statuses/18173eb0d9166aab8a72cf22dc67efeb4569ca83"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"alexellis"}}