{"action":"created","comment":{"url":"https://api.github.com/repos/docker/infrakit/pulls/comments/87289501","pull_request_review_id":7908375,"id":87289501,"diff_hunk":"@@ -0,0 +1,359 @@\n+package manager\n+\n+import (\n+\t\"encoding/json\"\n+\t\"fmt\"\n+\t\"strings\"\n+\t\"sync\"\n+\n+\tlog \"github.com/Sirupsen/logrus\"\n+\t\"github.com/docker/infrakit/discovery\"\n+\t\"github.com/docker/infrakit/leader\"\n+\trpc \"github.com/docker/infrakit/rpc/group\"\n+\t\"github.com/docker/infrakit/spi/group\"\n+\t\"github.com/docker/infrakit/store\"\n+)\n+\n+// Backend is the admin / server interface\n+type Backend interface {\n+\tgroup.Plugin\n+\n+\tStart() (<-chan struct{}, error)\n+\tStop()\n+}\n+\n+// manager is the controller of all the plugins.  It is able to process multiple inputs\n+// such as leadership changes and configuration changes and perform the necessary actions\n+// to activate / deactivate plugins\n+type manager struct {\n+\tgroup.Plugin\n+\n+\tplugins  discovery.Plugins\n+\tleader   leader.Detector\n+\tsnapshot store.Snapshot\n+\tisLeader bool\n+\tlock     sync.Mutex\n+\tstop     chan struct{}\n+\trunning  chan struct{}\n+\n+\tcurrentConfig GlobalSpec\n+\n+\tbackendName string\n+\tbackendOps  chan<- backendOp\n+}\n+\n+type backendOp struct {\n+\tn   string","path":"manager/manager.go","position":46,"original_position":46,"commit_id":"2668c2386ec12e286a80c5ad74a5caf63073ee8f","original_commit_id":"2391fd45ba0e43de99f00d35f9b99c18afe53f49","user":{"login":"chungers","id":299504,"avatar_url":"https://avatars.githubusercontent.com/u/299504?v=3","gravatar_id":"","url":"https://api.github.com/users/chungers","html_url":"https://github.com/chungers","followers_url":"https://api.github.com/users/chungers/followers","following_url":"https://api.github.com/users/chungers/following{/other_user}","gists_url":"https://api.github.com/users/chungers/gists{/gist_id}","starred_url":"https://api.github.com/users/chungers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chungers/subscriptions","organizations_url":"https://api.github.com/users/chungers/orgs","repos_url":"https://api.github.com/users/chungers/repos","events_url":"https://api.github.com/users/chungers/events{/privacy}","received_events_url":"https://api.github.com/users/chungers/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-11-09T22:16:17Z","updated_at":"2016-11-09T22:16:17Z","html_url":"https://github.com/docker/infrakit/pull/283#discussion_r87289501","pull_request_url":"https://api.github.com/repos/docker/infrakit/pulls/283","_links":{"self":{"href":"https://api.github.com/repos/docker/infrakit/pulls/comments/87289501"},"html":{"href":"https://github.com/docker/infrakit/pull/283#discussion_r87289501"},"pull_request":{"href":"https://api.github.com/repos/docker/infrakit/pulls/283"}}},"pull_request":{"url":"https://api.github.com/repos/docker/infrakit/pulls/283","id":92884235,"html_url":"https://github.com/docker/infrakit/pull/283","diff_url":"https://github.com/docker/infrakit/pull/283.diff","patch_url":"https://github.com/docker/infrakit/pull/283.patch","issue_url":"https://api.github.com/repos/docker/infrakit/issues/283","number":283,"state":"open","locked":false,"title":"Manager: a stateful group plugin with leader detection","user":{"login":"chungers","id":299504,"avatar_url":"https://avatars.githubusercontent.com/u/299504?v=3","gravatar_id":"","url":"https://api.github.com/users/chungers","html_url":"https://github.com/chungers","followers_url":"https://api.github.com/users/chungers/followers","following_url":"https://api.github.com/users/chungers/following{/other_user}","gists_url":"https://api.github.com/users/chungers/gists{/gist_id}","starred_url":"https://api.github.com/users/chungers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chungers/subscriptions","organizations_url":"https://api.github.com/users/chungers/orgs","repos_url":"https://api.github.com/users/chungers/repos","events_url":"https://api.github.com/users/chungers/events{/privacy}","received_events_url":"https://api.github.com/users/chungers/received_events","type":"User","site_admin":false},"body":"This PR combines the earlier PRs for state storage and leader detection to create\r\na manager (entity + cmd binary).  The manager offers a Group interface and can record\r\nstate in a swarm or local file.   \r\n\r\nThere's a new executable `infrakit-manager` that can be started as a point of contact for users.  This binary will handle leader detection.  See `cmd/manager/README.md` for details.\r\n\r\nSigned-off-by: David Chung <david.chung@docker.com>","created_at":"2016-11-09T00:01:36Z","updated_at":"2016-11-09T22:16:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6a58aaf354733ad420c899f48256bbda0c8f193","assignee":{"login":"wfarner","id":422563,"avatar_url":"https://avatars.githubusercontent.com/u/422563?v=3","gravatar_id":"","url":"https://api.github.com/users/wfarner","html_url":"https://github.com/wfarner","followers_url":"https://api.github.com/users/wfarner/followers","following_url":"https://api.github.com/users/wfarner/following{/other_user}","gists_url":"https://api.github.com/users/wfarner/gists{/gist_id}","starred_url":"https://api.github.com/users/wfarner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfarner/subscriptions","organizations_url":"https://api.github.com/users/wfarner/orgs","repos_url":"https://api.github.com/users/wfarner/repos","events_url":"https://api.github.com/users/wfarner/events{/privacy}","received_events_url":"https://api.github.com/users/wfarner/received_events","type":"User","site_admin":false},"assignees":[{"login":"wfarner","id":422563,"avatar_url":"https://avatars.githubusercontent.com/u/422563?v=3","gravatar_id":"","url":"https://api.github.com/users/wfarner","html_url":"https://github.com/wfarner","followers_url":"https://api.github.com/users/wfarner/followers","following_url":"https://api.github.com/users/wfarner/following{/other_user}","gists_url":"https://api.github.com/users/wfarner/gists{/gist_id}","starred_url":"https://api.github.com/users/wfarner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfarner/subscriptions","organizations_url":"https://api.github.com/users/wfarner/orgs","repos_url":"https://api.github.com/users/wfarner/repos","events_url":"https://api.github.com/users/wfarner/events{/privacy}","received_events_url":"https://api.github.com/users/wfarner/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/docker/infrakit/pulls/283/commits","review_comments_url":"https://api.github.com/repos/docker/infrakit/pulls/283/comments","review_comment_url":"https://api.github.com/repos/docker/infrakit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/infrakit/issues/283/comments","statuses_url":"https://api.github.com/repos/docker/infrakit/statuses/2668c2386ec12e286a80c5ad74a5caf63073ee8f","head":{"label":"chungers:stateful-group","ref":"stateful-group","sha":"2668c2386ec12e286a80c5ad74a5caf63073ee8f","user":{"login":"chungers","id":299504,"avatar_url":"https://avatars.githubusercontent.com/u/299504?v=3","gravatar_id":"","url":"https://api.github.com/users/chungers","html_url":"https://github.com/chungers","followers_url":"https://api.github.com/users/chungers/followers","following_url":"https://api.github.com/users/chungers/following{/other_user}","gists_url":"https://api.github.com/users/chungers/gists{/gist_id}","starred_url":"https://api.github.com/users/chungers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chungers/subscriptions","organizations_url":"https://api.github.com/users/chungers/orgs","repos_url":"https://api.github.com/users/chungers/repos","events_url":"https://api.github.com/users/chungers/events{/privacy}","received_events_url":"https://api.github.com/users/chungers/received_events","type":"User","site_admin":false},"repo":{"id":70004759,"name":"infrakit","full_name":"chungers/infrakit","owner":{"login":"chungers","id":299504,"avatar_url":"https://avatars.githubusercontent.com/u/299504?v=3","gravatar_id":"","url":"https://api.github.com/users/chungers","html_url":"https://github.com/chungers","followers_url":"https://api.github.com/users/chungers/followers","following_url":"https://api.github.com/users/chungers/following{/other_user}","gists_url":"https://api.github.com/users/chungers/gists{/gist_id}","starred_url":"https://api.github.com/users/chungers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chungers/subscriptions","organizations_url":"https://api.github.com/users/chungers/orgs","repos_url":"https://api.github.com/users/chungers/repos","events_url":"https://api.github.com/users/chungers/events{/privacy}","received_events_url":"https://api.github.com/users/chungers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chungers/infrakit","description":"A toolkit for creating and managing declarative, self-healing infrastructure.","fork":true,"url":"https://api.github.com/repos/chungers/infrakit","forks_url":"https://api.github.com/repos/chungers/infrakit/forks","keys_url":"https://api.github.com/repos/chungers/infrakit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chungers/infrakit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chungers/infrakit/teams","hooks_url":"https://api.github.com/repos/chungers/infrakit/hooks","issue_events_url":"https://api.github.com/repos/chungers/infrakit/issues/events{/number}","events_url":"https://api.github.com/repos/chungers/infrakit/events","assignees_url":"https://api.github.com/repos/chungers/infrakit/assignees{/user}","branches_url":"https://api.github.com/repos/chungers/infrakit/branches{/branch}","tags_url":"https://api.github.com/repos/chungers/infrakit/tags","blobs_url":"https://api.github.com/repos/chungers/infrakit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chungers/infrakit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chungers/infrakit/git/refs{/sha}","trees_url":"https://api.github.com/repos/chungers/infrakit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chungers/infrakit/statuses/{sha}","languages_url":"https://api.github.com/repos/chungers/infrakit/languages","stargazers_url":"https://api.github.com/repos/chungers/infrakit/stargazers","contributors_url":"https://api.github.com/repos/chungers/infrakit/contributors","subscribers_url":"https://api.github.com/repos/chungers/infrakit/subscribers","subscription_url":"https://api.github.com/repos/chungers/infrakit/subscription","commits_url":"https://api.github.com/repos/chungers/infrakit/commits{/sha}","git_commits_url":"https://api.github.com/repos/chungers/infrakit/git/commits{/sha}","comments_url":"https://api.github.com/repos/chungers/infrakit/comments{/number}","issue_comment_url":"https://api.github.com/repos/chungers/infrakit/issues/comments{/number}","contents_url":"https://api.github.com/repos/chungers/infrakit/contents/{+path}","compare_url":"https://api.github.com/repos/chungers/infrakit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chungers/infrakit/merges","archive_url":"https://api.github.com/repos/chungers/infrakit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chungers/infrakit/downloads","issues_url":"https://api.github.com/repos/chungers/infrakit/issues{/number}","pulls_url":"https://api.github.com/repos/chungers/infrakit/pulls{/number}","milestones_url":"https://api.github.com/repos/chungers/infrakit/milestones{/number}","notifications_url":"https://api.github.com/repos/chungers/infrakit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chungers/infrakit/labels{/name}","releases_url":"https://api.github.com/repos/chungers/infrakit/releases{/id}","deployments_url":"https://api.github.com/repos/chungers/infrakit/deployments","created_at":"2016-10-04T20:45:08Z","updated_at":"2016-10-04T20:45:09Z","pushed_at":"2016-11-09T21:55:48Z","git_url":"git://github.com/chungers/infrakit.git","ssh_url":"git@github.com:chungers/infrakit.git","clone_url":"https://github.com/chungers/infrakit.git","svn_url":"https://github.com/chungers/infrakit","homepage":"","size":8794,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"89a65c08ca3a74a8b4ff93c37de9e7d7a82b5948","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":55811475,"name":"infrakit","full_name":"docker/infrakit","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/infrakit","description":"A toolkit for creating and managing declarative, self-healing infrastructure.","fork":false,"url":"https://api.github.com/repos/docker/infrakit","forks_url":"https://api.github.com/repos/docker/infrakit/forks","keys_url":"https://api.github.com/repos/docker/infrakit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/infrakit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/infrakit/teams","hooks_url":"https://api.github.com/repos/docker/infrakit/hooks","issue_events_url":"https://api.github.com/repos/docker/infrakit/issues/events{/number}","events_url":"https://api.github.com/repos/docker/infrakit/events","assignees_url":"https://api.github.com/repos/docker/infrakit/assignees{/user}","branches_url":"https://api.github.com/repos/docker/infrakit/branches{/branch}","tags_url":"https://api.github.com/repos/docker/infrakit/tags","blobs_url":"https://api.github.com/repos/docker/infrakit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/infrakit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/infrakit/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/infrakit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/infrakit/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/infrakit/languages","stargazers_url":"https://api.github.com/repos/docker/infrakit/stargazers","contributors_url":"https://api.github.com/repos/docker/infrakit/contributors","subscribers_url":"https://api.github.com/repos/docker/infrakit/subscribers","subscription_url":"https://api.github.com/repos/docker/infrakit/subscription","commits_url":"https://api.github.com/repos/docker/infrakit/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/infrakit/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/infrakit/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/infrakit/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/infrakit/contents/{+path}","compare_url":"https://api.github.com/repos/docker/infrakit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/infrakit/merges","archive_url":"https://api.github.com/repos/docker/infrakit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/infrakit/downloads","issues_url":"https://api.github.com/repos/docker/infrakit/issues{/number}","pulls_url":"https://api.github.com/repos/docker/infrakit/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/infrakit/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/infrakit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/infrakit/labels{/name}","releases_url":"https://api.github.com/repos/docker/infrakit/releases{/id}","deployments_url":"https://api.github.com/repos/docker/infrakit/deployments","created_at":"2016-04-08T21:43:02Z","updated_at":"2016-11-09T04:17:55Z","pushed_at":"2016-11-09T21:55:48Z","git_url":"git://github.com/docker/infrakit.git","ssh_url":"git@github.com:docker/infrakit.git","clone_url":"https://github.com/docker/infrakit.git","svn_url":"https://github.com/docker/infrakit","homepage":"","size":18156,"stargazers_count":1156,"watchers_count":1156,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":88,"mirror_url":null,"open_issues_count":19,"forks":88,"open_issues":19,"watchers":1156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/infrakit/pulls/283"},"html":{"href":"https://github.com/docker/infrakit/pull/283"},"issue":{"href":"https://api.github.com/repos/docker/infrakit/issues/283"},"comments":{"href":"https://api.github.com/repos/docker/infrakit/issues/283/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/infrakit/pulls/283/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/infrakit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/infrakit/pulls/283/commits"},"statuses":{"href":"https://api.github.com/repos/docker/infrakit/statuses/2668c2386ec12e286a80c5ad74a5caf63073ee8f"}}}}
{"actor":{"display_login":"chungers"}}