{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/45776587","id":45776587,"diff_hunk":"@@ -0,0 +1,74 @@\n+package container\n+\n+import (\n+\t\"io\"\n+\t\"time\"\n+\n+\t\"github.com/docker/docker/api/types\"\n+\t\"github.com/docker/docker/daemon\"\n+\t\"github.com/docker/docker/daemon/exec\"\n+\t\"github.com/docker/docker/pkg/archive\"\n+\t\"github.com/docker/docker/pkg/version\"\n+\t\"github.com/docker/docker/runconfig\"\n+)\n+\n+// execBackend includes functions to implement to provide exec functionality.\n+type execBackend interface {\n+\tContainerExecCreate(config *runconfig.ExecConfig) (string, error)\n+\tContainerExecInspect(id string) (*exec.Config, error)\n+\tContainerExecResize(name string, height, width int) error\n+\tContainerExecStart(name string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) error\n+\tExecExists(name string) (bool, error)\n+}\n+\n+// copyBackend includes functions to implement to provide container copy functionality.\n+type copyBackend interface {\n+\tContainerArchivePath(name string, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error)\n+\tContainerCopy(name string, res string) (io.ReadCloser, error)\n+\tContainerExport(name string, out io.Writer) error\n+\tContainerExtractToDir(name, path string, noOverwriteDirNonDir bool, content io.Reader) error\n+\tContainerStatPath(name string, path string) (stat *types.ContainerPathStat, err error)\n+}\n+\n+// stateBackend includes functions to implement to provide container state lifecycle functionality.\n+type stateBackend interface {\n+\tContainerCreate(params *daemon.ContainerCreateConfig) (types.ContainerCreateResponse, error)\n+\tContainerKill(name string, sig uint64) error\n+\tContainerPause(name string) error\n+\tContainerRename(oldName, newName string) error\n+\tContainerResize(name string, height, width int) error\n+\tContainerRestart(name string, seconds int) error\n+\tContainerRm(name string, config *daemon.ContainerRmConfig) error\n+\tContainerStart(name string, hostConfig *runconfig.HostConfig) error\n+\tContainerStop(name string, seconds int) error\n+\tContainerUnpause(name string) error\n+\tContainerWait(name string, timeout time.Duration) (int, error)\n+\tExists(id string) bool\n+\tIsPaused(id string) bool\n+}\n+\n+// monitorBackend includes functions to implement to provide containers monitoring functionality.\n+type monitorBackend interface {\n+\tContainerChanges(name string) ([]archive.Change, error)\n+\tContainerInspect(name string, size bool, version version.Version) (interface{}, error)","path":"api/server/router/container/backend.go","position":53,"original_position":53,"commit_id":"5bcc508a0bf29ad40105cfcd104ee121a9515a14","original_commit_id":"5bcc508a0bf29ad40105cfcd104ee121a9515a14","user":{"login":"MHBauer","id":13337345,"avatar_url":"https://avatars.githubusercontent.com/u/13337345?v=3","gravatar_id":"","url":"https://api.github.com/users/MHBauer","html_url":"https://github.com/MHBauer","followers_url":"https://api.github.com/users/MHBauer/followers","following_url":"https://api.github.com/users/MHBauer/following{/other_user}","gists_url":"https://api.github.com/users/MHBauer/gists{/gist_id}","starred_url":"https://api.github.com/users/MHBauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MHBauer/subscriptions","organizations_url":"https://api.github.com/users/MHBauer/orgs","repos_url":"https://api.github.com/users/MHBauer/repos","events_url":"https://api.github.com/users/MHBauer/events{/privacy}","received_events_url":"https://api.github.com/users/MHBauer/received_events","type":"User","site_admin":false},"body":"I'm about to lookup `interface{}` and what this means and does, but do you have a quick description of what's happening here and why this works?","created_at":"2015-11-24T18:46:18Z","updated_at":"2015-11-24T18:46:18Z","html_url":"https://github.com/docker/docker/pull/18201#discussion_r45776587","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/18201","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/45776587"},"html":{"href":"https://github.com/docker/docker/pull/18201#discussion_r45776587"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/18201"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/18201","id":51699160,"html_url":"https://github.com/docker/docker/pull/18201","diff_url":"https://github.com/docker/docker/pull/18201.diff","patch_url":"https://github.com/docker/docker/pull/18201.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/18201","number":18201,"state":"open","locked":false,"title":"[Carry 17736] Container router and backend.","user":{"login":"calavera","id":1050,"avatar_url":"https://avatars.githubusercontent.com/u/1050?v=3","gravatar_id":"","url":"https://api.github.com/users/calavera","html_url":"https://github.com/calavera","followers_url":"https://api.github.com/users/calavera/followers","following_url":"https://api.github.com/users/calavera/following{/other_user}","gists_url":"https://api.github.com/users/calavera/gists{/gist_id}","starred_url":"https://api.github.com/users/calavera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calavera/subscriptions","organizations_url":"https://api.github.com/users/calavera/orgs","repos_url":"https://api.github.com/users/calavera/repos","events_url":"https://api.github.com/users/calavera/events{/privacy}","received_events_url":"https://api.github.com/users/calavera/received_events","type":"User","site_admin":false},"body":"- Group container apis into a single router.\n- Split backend into small specialliced backends that the docker daemon implements.\n- Move inspect version logic to the backend: I'm not very happy of returning an `interface{}`, but I don't really know how to identify an interface for a type that doesn't include any functions.","created_at":"2015-11-24T18:38:40Z","updated_at":"2015-11-24T18:46:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9887f239d53304250ad7c1965107534e0a3eb48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/18201/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/18201/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/18201/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/5bcc508a0bf29ad40105cfcd104ee121a9515a14","head":{"label":"calavera:split_container_router","ref":"split_container_router","sha":"5bcc508a0bf29ad40105cfcd104ee121a9515a14","user":{"login":"calavera","id":1050,"avatar_url":"https://avatars.githubusercontent.com/u/1050?v=3","gravatar_id":"","url":"https://api.github.com/users/calavera","html_url":"https://github.com/calavera","followers_url":"https://api.github.com/users/calavera/followers","following_url":"https://api.github.com/users/calavera/following{/other_user}","gists_url":"https://api.github.com/users/calavera/gists{/gist_id}","starred_url":"https://api.github.com/users/calavera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calavera/subscriptions","organizations_url":"https://api.github.com/users/calavera/orgs","repos_url":"https://api.github.com/users/calavera/repos","events_url":"https://api.github.com/users/calavera/events{/privacy}","received_events_url":"https://api.github.com/users/calavera/received_events","type":"User","site_admin":false},"repo":{"id":11697698,"name":"docker","full_name":"calavera/docker","owner":{"login":"calavera","id":1050,"avatar_url":"https://avatars.githubusercontent.com/u/1050?v=3","gravatar_id":"","url":"https://api.github.com/users/calavera","html_url":"https://github.com/calavera","followers_url":"https://api.github.com/users/calavera/followers","following_url":"https://api.github.com/users/calavera/following{/other_user}","gists_url":"https://api.github.com/users/calavera/gists{/gist_id}","starred_url":"https://api.github.com/users/calavera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calavera/subscriptions","organizations_url":"https://api.github.com/users/calavera/orgs","repos_url":"https://api.github.com/users/calavera/repos","events_url":"https://api.github.com/users/calavera/events{/privacy}","received_events_url":"https://api.github.com/users/calavera/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calavera/docker","description":"Docker - the Linux container runtime","fork":true,"url":"https://api.github.com/repos/calavera/docker","forks_url":"https://api.github.com/repos/calavera/docker/forks","keys_url":"https://api.github.com/repos/calavera/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calavera/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calavera/docker/teams","hooks_url":"https://api.github.com/repos/calavera/docker/hooks","issue_events_url":"https://api.github.com/repos/calavera/docker/issues/events{/number}","events_url":"https://api.github.com/repos/calavera/docker/events","assignees_url":"https://api.github.com/repos/calavera/docker/assignees{/user}","branches_url":"https://api.github.com/repos/calavera/docker/branches{/branch}","tags_url":"https://api.github.com/repos/calavera/docker/tags","blobs_url":"https://api.github.com/repos/calavera/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calavera/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calavera/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/calavera/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calavera/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/calavera/docker/languages","stargazers_url":"https://api.github.com/repos/calavera/docker/stargazers","contributors_url":"https://api.github.com/repos/calavera/docker/contributors","subscribers_url":"https://api.github.com/repos/calavera/docker/subscribers","subscription_url":"https://api.github.com/repos/calavera/docker/subscription","commits_url":"https://api.github.com/repos/calavera/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/calavera/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/calavera/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/calavera/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/calavera/docker/contents/{+path}","compare_url":"https://api.github.com/repos/calavera/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calavera/docker/merges","archive_url":"https://api.github.com/repos/calavera/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calavera/docker/downloads","issues_url":"https://api.github.com/repos/calavera/docker/issues{/number}","pulls_url":"https://api.github.com/repos/calavera/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/calavera/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/calavera/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calavera/docker/labels{/name}","releases_url":"https://api.github.com/repos/calavera/docker/releases{/id}","created_at":"2013-07-27T00:49:52Z","updated_at":"2014-07-24T21:22:23Z","pushed_at":"2015-11-24T18:35:51Z","git_url":"git://github.com/calavera/docker.git","ssh_url":"git@github.com:calavera/docker.git","clone_url":"https://github.com/calavera/docker.git","svn_url":"https://github.com/calavera/docker","homepage":"http://docker.io","size":77802,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"0dec4403b0a6f5f56d37e22565bf060da8f399df","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":7691631,"name":"docker","full_name":"docker/docker","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/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-11-24T18:19:59Z","pushed_at":"2015-11-24T18:38:40Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":117003,"stargazers_count":26520,"watchers_count":26520,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7157,"mirror_url":null,"open_issues_count":1187,"forks":7157,"open_issues":1187,"watchers":26520,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/18201"},"html":{"href":"https://github.com/docker/docker/pull/18201"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/18201"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/18201/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/18201/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/18201/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/5bcc508a0bf29ad40105cfcd104ee121a9515a14"}}}}