{"action":"created","comment":{"url":"https://api.github.com/repos/kelseyhightower/confd/pulls/comments/24620911","id":24620911,"diff_hunk":"@@ -0,0 +1,63 @@\n+package fs\n+\n+import (\n+\t\"os\"\n+\t\"io/ioutil\"\n+\t\"path\"\n+\t\"path/filepath\"\n+\t\"strings\"\n+)\n+\n+type Client struct {\n+\trootPath    string\n+\tmaxFileSize int64\n+}\n+\n+func NewFsClient() (*Client, error) {\n+\t// TODO: how to provide rootPath in order to pass tests?\n+\trootPath := os.Getenv(\"BACKEND_FS_ROOTPATH\")\n+\t// TODO: limit in size (for now 10mb), maybe retrieve from args or etcd default value or whatever.\n+\tmaxFileSize := int64(10485760)\n+\treturn &Client{rootPath, maxFileSize}, nil\n+}\n+\n+func (c *Client) GetValues(keys []string) (map[string]string, error) {\n+\tvars := make(map[string]string)\n+\tfor _, key := range keys {\n+\t\tkeyPath := path.Join(c.rootPath, key)\n+\t\tif _, err := os.Stat(keyPath); os.IsNotExist(err) {\n+\t\t\treturn vars, err\n+\t\t}\n+\n+\t\twalk := func(fpath string, fi os.FileInfo, err error) error {\n+\t\t\tif (err != nil) {","path":"backends/fs/client.go","position":33,"original_position":33,"commit_id":"c8972755f2072855d8f9718329b16d9b25a34e0f","original_commit_id":"c8972755f2072855d8f9718329b16d9b25a34e0f","user":{"login":"bacongobbler","id":1360539,"avatar_url":"https://avatars.githubusercontent.com/u/1360539?v=3","gravatar_id":"","url":"https://api.github.com/users/bacongobbler","html_url":"https://github.com/bacongobbler","followers_url":"https://api.github.com/users/bacongobbler/followers","following_url":"https://api.github.com/users/bacongobbler/following{/other_user}","gists_url":"https://api.github.com/users/bacongobbler/gists{/gist_id}","starred_url":"https://api.github.com/users/bacongobbler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bacongobbler/subscriptions","organizations_url":"https://api.github.com/users/bacongobbler/orgs","repos_url":"https://api.github.com/users/bacongobbler/repos","events_url":"https://api.github.com/users/bacongobbler/events{/privacy}","received_events_url":"https://api.github.com/users/bacongobbler/received_events","type":"User","site_admin":false},"body":"From https://golang.org/doc/effective_go.html#control-structures, parentheses in control structures are not allowed. You should've seen compile errors IIRC","created_at":"2015-02-12T21:15:30Z","updated_at":"2015-02-12T21:15:30Z","html_url":"https://github.com/kelseyhightower/confd/pull/201#discussion_r24620911","pull_request_url":"https://api.github.com/repos/kelseyhightower/confd/pulls/201","_links":{"self":{"href":"https://api.github.com/repos/kelseyhightower/confd/pulls/comments/24620911"},"html":{"href":"https://github.com/kelseyhightower/confd/pull/201#discussion_r24620911"},"pull_request":{"href":"https://api.github.com/repos/kelseyhightower/confd/pulls/201"}}},"pull_request":{"url":"https://api.github.com/repos/kelseyhightower/confd/pulls/201","id":29215599,"html_url":"https://github.com/kelseyhightower/confd/pull/201","diff_url":"https://github.com/kelseyhightower/confd/pull/201.diff","patch_url":"https://github.com/kelseyhightower/confd/pull/201.patch","issue_url":"https://api.github.com/repos/kelseyhightower/confd/issues/201","number":201,"state":"open","locked":false,"title":"add filesystem support","user":{"login":"glerchundi","id":2232214,"avatar_url":"https://avatars.githubusercontent.com/u/2232214?v=3","gravatar_id":"","url":"https://api.github.com/users/glerchundi","html_url":"https://github.com/glerchundi","followers_url":"https://api.github.com/users/glerchundi/followers","following_url":"https://api.github.com/users/glerchundi/following{/other_user}","gists_url":"https://api.github.com/users/glerchundi/gists{/gist_id}","starred_url":"https://api.github.com/users/glerchundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glerchundi/subscriptions","organizations_url":"https://api.github.com/users/glerchundi/orgs","repos_url":"https://api.github.com/users/glerchundi/repos","events_url":"https://api.github.com/users/glerchundi/events{/privacy}","received_events_url":"https://api.github.com/users/glerchundi/received_events","type":"User","site_admin":false},"body":"* watch is not yet supported - see backends/fs/client.go for details\r\n* integration should work\r\n* exit if watch is enabled when fs is defined as backend\r\n\r\nTested with go 1.4","created_at":"2015-02-12T21:00:39Z","updated_at":"2015-02-12T21:15:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b8e3358734546a1186e26aa4ef7c1d0bf2f564a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kelseyhightower/confd/pulls/201/commits","review_comments_url":"https://api.github.com/repos/kelseyhightower/confd/pulls/201/comments","review_comment_url":"https://api.github.com/repos/kelseyhightower/confd/pulls/comments/{number}","comments_url":"https://api.github.com/repos/kelseyhightower/confd/issues/201/comments","statuses_url":"https://api.github.com/repos/kelseyhightower/confd/statuses/c8972755f2072855d8f9718329b16d9b25a34e0f","head":{"label":"glerchundi:master","ref":"master","sha":"c8972755f2072855d8f9718329b16d9b25a34e0f","user":{"login":"glerchundi","id":2232214,"avatar_url":"https://avatars.githubusercontent.com/u/2232214?v=3","gravatar_id":"","url":"https://api.github.com/users/glerchundi","html_url":"https://github.com/glerchundi","followers_url":"https://api.github.com/users/glerchundi/followers","following_url":"https://api.github.com/users/glerchundi/following{/other_user}","gists_url":"https://api.github.com/users/glerchundi/gists{/gist_id}","starred_url":"https://api.github.com/users/glerchundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glerchundi/subscriptions","organizations_url":"https://api.github.com/users/glerchundi/orgs","repos_url":"https://api.github.com/users/glerchundi/repos","events_url":"https://api.github.com/users/glerchundi/events{/privacy}","received_events_url":"https://api.github.com/users/glerchundi/received_events","type":"User","site_admin":false},"repo":{"id":30704860,"name":"confd","full_name":"glerchundi/confd","owner":{"login":"glerchundi","id":2232214,"avatar_url":"https://avatars.githubusercontent.com/u/2232214?v=3","gravatar_id":"","url":"https://api.github.com/users/glerchundi","html_url":"https://github.com/glerchundi","followers_url":"https://api.github.com/users/glerchundi/followers","following_url":"https://api.github.com/users/glerchundi/following{/other_user}","gists_url":"https://api.github.com/users/glerchundi/gists{/gist_id}","starred_url":"https://api.github.com/users/glerchundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glerchundi/subscriptions","organizations_url":"https://api.github.com/users/glerchundi/orgs","repos_url":"https://api.github.com/users/glerchundi/repos","events_url":"https://api.github.com/users/glerchundi/events{/privacy}","received_events_url":"https://api.github.com/users/glerchundi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/glerchundi/confd","description":"Manage local application configuration files using templates and data from etcd or consul","fork":true,"url":"https://api.github.com/repos/glerchundi/confd","forks_url":"https://api.github.com/repos/glerchundi/confd/forks","keys_url":"https://api.github.com/repos/glerchundi/confd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glerchundi/confd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glerchundi/confd/teams","hooks_url":"https://api.github.com/repos/glerchundi/confd/hooks","issue_events_url":"https://api.github.com/repos/glerchundi/confd/issues/events{/number}","events_url":"https://api.github.com/repos/glerchundi/confd/events","assignees_url":"https://api.github.com/repos/glerchundi/confd/assignees{/user}","branches_url":"https://api.github.com/repos/glerchundi/confd/branches{/branch}","tags_url":"https://api.github.com/repos/glerchundi/confd/tags","blobs_url":"https://api.github.com/repos/glerchundi/confd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glerchundi/confd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glerchundi/confd/git/refs{/sha}","trees_url":"https://api.github.com/repos/glerchundi/confd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glerchundi/confd/statuses/{sha}","languages_url":"https://api.github.com/repos/glerchundi/confd/languages","stargazers_url":"https://api.github.com/repos/glerchundi/confd/stargazers","contributors_url":"https://api.github.com/repos/glerchundi/confd/contributors","subscribers_url":"https://api.github.com/repos/glerchundi/confd/subscribers","subscription_url":"https://api.github.com/repos/glerchundi/confd/subscription","commits_url":"https://api.github.com/repos/glerchundi/confd/commits{/sha}","git_commits_url":"https://api.github.com/repos/glerchundi/confd/git/commits{/sha}","comments_url":"https://api.github.com/repos/glerchundi/confd/comments{/number}","issue_comment_url":"https://api.github.com/repos/glerchundi/confd/issues/comments/{number}","contents_url":"https://api.github.com/repos/glerchundi/confd/contents/{+path}","compare_url":"https://api.github.com/repos/glerchundi/confd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glerchundi/confd/merges","archive_url":"https://api.github.com/repos/glerchundi/confd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glerchundi/confd/downloads","issues_url":"https://api.github.com/repos/glerchundi/confd/issues{/number}","pulls_url":"https://api.github.com/repos/glerchundi/confd/pulls{/number}","milestones_url":"https://api.github.com/repos/glerchundi/confd/milestones{/number}","notifications_url":"https://api.github.com/repos/glerchundi/confd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glerchundi/confd/labels{/name}","releases_url":"https://api.github.com/repos/glerchundi/confd/releases{/id}","created_at":"2015-02-12T13:58:34Z","updated_at":"2015-02-12T20:56:20Z","pushed_at":"2015-02-12T20:56:20Z","git_url":"git://github.com/glerchundi/confd.git","ssh_url":"git@github.com:glerchundi/confd.git","clone_url":"https://github.com/glerchundi/confd.git","svn_url":"https://github.com/glerchundi/confd","homepage":"","size":2283,"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":"kelseyhightower:master","ref":"master","sha":"41fff86a04f93564c68376c73a96de1e10ebebee","user":{"login":"kelseyhightower","id":1123322,"avatar_url":"https://avatars.githubusercontent.com/u/1123322?v=3","gravatar_id":"","url":"https://api.github.com/users/kelseyhightower","html_url":"https://github.com/kelseyhightower","followers_url":"https://api.github.com/users/kelseyhightower/followers","following_url":"https://api.github.com/users/kelseyhightower/following{/other_user}","gists_url":"https://api.github.com/users/kelseyhightower/gists{/gist_id}","starred_url":"https://api.github.com/users/kelseyhightower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelseyhightower/subscriptions","organizations_url":"https://api.github.com/users/kelseyhightower/orgs","repos_url":"https://api.github.com/users/kelseyhightower/repos","events_url":"https://api.github.com/users/kelseyhightower/events{/privacy}","received_events_url":"https://api.github.com/users/kelseyhightower/received_events","type":"User","site_admin":false},"repo":{"id":13234395,"name":"confd","full_name":"kelseyhightower/confd","owner":{"login":"kelseyhightower","id":1123322,"avatar_url":"https://avatars.githubusercontent.com/u/1123322?v=3","gravatar_id":"","url":"https://api.github.com/users/kelseyhightower","html_url":"https://github.com/kelseyhightower","followers_url":"https://api.github.com/users/kelseyhightower/followers","following_url":"https://api.github.com/users/kelseyhightower/following{/other_user}","gists_url":"https://api.github.com/users/kelseyhightower/gists{/gist_id}","starred_url":"https://api.github.com/users/kelseyhightower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelseyhightower/subscriptions","organizations_url":"https://api.github.com/users/kelseyhightower/orgs","repos_url":"https://api.github.com/users/kelseyhightower/repos","events_url":"https://api.github.com/users/kelseyhightower/events{/privacy}","received_events_url":"https://api.github.com/users/kelseyhightower/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kelseyhightower/confd","description":"Manage local application configuration files using templates and data from etcd or consul","fork":false,"url":"https://api.github.com/repos/kelseyhightower/confd","forks_url":"https://api.github.com/repos/kelseyhightower/confd/forks","keys_url":"https://api.github.com/repos/kelseyhightower/confd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kelseyhightower/confd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kelseyhightower/confd/teams","hooks_url":"https://api.github.com/repos/kelseyhightower/confd/hooks","issue_events_url":"https://api.github.com/repos/kelseyhightower/confd/issues/events{/number}","events_url":"https://api.github.com/repos/kelseyhightower/confd/events","assignees_url":"https://api.github.com/repos/kelseyhightower/confd/assignees{/user}","branches_url":"https://api.github.com/repos/kelseyhightower/confd/branches{/branch}","tags_url":"https://api.github.com/repos/kelseyhightower/confd/tags","blobs_url":"https://api.github.com/repos/kelseyhightower/confd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kelseyhightower/confd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kelseyhightower/confd/git/refs{/sha}","trees_url":"https://api.github.com/repos/kelseyhightower/confd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kelseyhightower/confd/statuses/{sha}","languages_url":"https://api.github.com/repos/kelseyhightower/confd/languages","stargazers_url":"https://api.github.com/repos/kelseyhightower/confd/stargazers","contributors_url":"https://api.github.com/repos/kelseyhightower/confd/contributors","subscribers_url":"https://api.github.com/repos/kelseyhightower/confd/subscribers","subscription_url":"https://api.github.com/repos/kelseyhightower/confd/subscription","commits_url":"https://api.github.com/repos/kelseyhightower/confd/commits{/sha}","git_commits_url":"https://api.github.com/repos/kelseyhightower/confd/git/commits{/sha}","comments_url":"https://api.github.com/repos/kelseyhightower/confd/comments{/number}","issue_comment_url":"https://api.github.com/repos/kelseyhightower/confd/issues/comments/{number}","contents_url":"https://api.github.com/repos/kelseyhightower/confd/contents/{+path}","compare_url":"https://api.github.com/repos/kelseyhightower/confd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kelseyhightower/confd/merges","archive_url":"https://api.github.com/repos/kelseyhightower/confd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kelseyhightower/confd/downloads","issues_url":"https://api.github.com/repos/kelseyhightower/confd/issues{/number}","pulls_url":"https://api.github.com/repos/kelseyhightower/confd/pulls{/number}","milestones_url":"https://api.github.com/repos/kelseyhightower/confd/milestones{/number}","notifications_url":"https://api.github.com/repos/kelseyhightower/confd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kelseyhightower/confd/labels{/name}","releases_url":"https://api.github.com/repos/kelseyhightower/confd/releases{/id}","created_at":"2013-10-01T04:06:09Z","updated_at":"2015-02-12T19:15:52Z","pushed_at":"2015-02-11T20:49:33Z","git_url":"git://github.com/kelseyhightower/confd.git","ssh_url":"git@github.com:kelseyhightower/confd.git","clone_url":"https://github.com/kelseyhightower/confd.git","svn_url":"https://github.com/kelseyhightower/confd","homepage":"","size":2283,"stargazers_count":1347,"watchers_count":1347,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":133,"mirror_url":null,"open_issues_count":22,"forks":133,"open_issues":22,"watchers":1347,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kelseyhightower/confd/pulls/201"},"html":{"href":"https://github.com/kelseyhightower/confd/pull/201"},"issue":{"href":"https://api.github.com/repos/kelseyhightower/confd/issues/201"},"comments":{"href":"https://api.github.com/repos/kelseyhightower/confd/issues/201/comments"},"review_comments":{"href":"https://api.github.com/repos/kelseyhightower/confd/pulls/201/comments"},"review_comment":{"href":"https://api.github.com/repos/kelseyhightower/confd/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/kelseyhightower/confd/pulls/201/commits"},"statuses":{"href":"https://api.github.com/repos/kelseyhightower/confd/statuses/c8972755f2072855d8f9718329b16d9b25a34e0f"}}}}