{"action":"created","comment":{"url":"https://api.github.com/repos/mesg-foundation/core/pulls/comments/191637081","pull_request_review_id":124243630,"id":191637081,"diff_hunk":"@@ -0,0 +1,62 @@\n+package container\n+\n+import (\n+\tgodocker \"github.com/fsouza/go-dockerclient\"\n+)\n+\n+// CreateNetwork creates a Docker Network with a namespace\n+func CreateNetwork(namespace []string) (network *godocker.Network, err error) {\n+\tnetwork, err = FindNetwork(namespace)\n+\tif network != nil || err != nil {\n+\t\treturn\n+\t}\n+\tnamespaceFlat := Namespace(namespace)\n+\tclient, err := Client()\n+\tif err != nil {\n+\t\treturn\n+\t}\n+\tnetwork, err = client.CreateNetwork(godocker.CreateNetworkOptions{\n+\t\tName:           namespaceFlat,\n+\t\tCheckDuplicate: true, // Cannot have 2 network with the same name\n+\t\tDriver:         \"overlay\",\n+\t\tLabels: map[string]string{\n+\t\t\t\"com.docker.stack.namespace\": namespaceFlat,\n+\t\t},\n+\t})\n+\treturn\n+}\n+\n+// DeleteNetwork deletes a Docker Network associated with a namespace\n+func DeleteNetwork(namespace []string) (err error) {\n+\tnetwork, err := FindNetwork(namespace)\n+\tif network == nil || err != nil {\n+\t\treturn\n+\t}\n+\tclient, err := Client()\n+\tif err != nil {\n+\t\treturn\n+\t}\n+\treturn client.RemoveNetwork(network.ID)\n+}\n+\n+// FindNetworkStrict finds a Docker Network by a namespace. If no network if found, an error is returned.\n+func FindNetworkStrict(namespace []string) (network *godocker.Network, err error) {","path":"container/network.go","position":null,"original_position":43,"commit_id":"def68e112a212d5204d04495d92f62e1c100537b","original_commit_id":"7cdef4c4c6717abd87b97b9cfbc0f59e259d1f9e","user":{"login":"antho1404","id":1783126,"avatar_url":"https://avatars2.githubusercontent.com/u/1783126?v=4","gravatar_id":"","url":"https://api.github.com/users/antho1404","html_url":"https://github.com/antho1404","followers_url":"https://api.github.com/users/antho1404/followers","following_url":"https://api.github.com/users/antho1404/following{/other_user}","gists_url":"https://api.github.com/users/antho1404/gists{/gist_id}","starred_url":"https://api.github.com/users/antho1404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antho1404/subscriptions","organizations_url":"https://api.github.com/users/antho1404/orgs","repos_url":"https://api.github.com/users/antho1404/repos","events_url":"https://api.github.com/users/antho1404/events{/privacy}","received_events_url":"https://api.github.com/users/antho1404/received_events","type":"User","site_admin":false},"body":"So every functions like that should have the same behavior which is to be strict. If we ask to find for something it means it should be here otherwise we should have a search or something like that","created_at":"2018-05-30T04:02:50Z","updated_at":"2018-05-30T04:02:50Z","html_url":"https://github.com/mesg-foundation/core/pull/169#discussion_r191637081","pull_request_url":"https://api.github.com/repos/mesg-foundation/core/pulls/169","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mesg-foundation/core/pulls/comments/191637081"},"html":{"href":"https://github.com/mesg-foundation/core/pull/169#discussion_r191637081"},"pull_request":{"href":"https://api.github.com/repos/mesg-foundation/core/pulls/169"}},"in_reply_to_id":191412149},"pull_request":{"url":"https://api.github.com/repos/mesg-foundation/core/pulls/169","id":191111697,"html_url":"https://github.com/mesg-foundation/core/pull/169","diff_url":"https://github.com/mesg-foundation/core/pull/169.diff","patch_url":"https://github.com/mesg-foundation/core/pull/169.patch","issue_url":"https://api.github.com/repos/mesg-foundation/core/issues/169","number":169,"state":"open","locked":false,"title":"Move docker related function to a dedicated package","user":{"login":"NicolasMahe","id":5823445,"avatar_url":"https://avatars1.githubusercontent.com/u/5823445?v=4","gravatar_id":"","url":"https://api.github.com/users/NicolasMahe","html_url":"https://github.com/NicolasMahe","followers_url":"https://api.github.com/users/NicolasMahe/followers","following_url":"https://api.github.com/users/NicolasMahe/following{/other_user}","gists_url":"https://api.github.com/users/NicolasMahe/gists{/gist_id}","starred_url":"https://api.github.com/users/NicolasMahe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicolasMahe/subscriptions","organizations_url":"https://api.github.com/users/NicolasMahe/orgs","repos_url":"https://api.github.com/users/NicolasMahe/repos","events_url":"https://api.github.com/users/NicolasMahe/events{/privacy}","received_events_url":"https://api.github.com/users/NicolasMahe/received_events","type":"User","site_admin":false},"body":"This PR add a new package container that handle all the docker related stuff\r\n\r\nClose #91 ","created_at":"2018-05-29T11:16:57Z","updated_at":"2018-05-30T04:02:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f17f9e946abd0494115881f7bdb3a40986451f3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mesg-foundation/core/pulls/169/commits","review_comments_url":"https://api.github.com/repos/mesg-foundation/core/pulls/169/comments","review_comment_url":"https://api.github.com/repos/mesg-foundation/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesg-foundation/core/issues/169/comments","statuses_url":"https://api.github.com/repos/mesg-foundation/core/statuses/def68e112a212d5204d04495d92f62e1c100537b","head":{"label":"mesg-foundation:refacto-docker","ref":"refacto-docker","sha":"def68e112a212d5204d04495d92f62e1c100537b","user":{"login":"mesg-foundation","id":34158802,"avatar_url":"https://avatars1.githubusercontent.com/u/34158802?v=4","gravatar_id":"","url":"https://api.github.com/users/mesg-foundation","html_url":"https://github.com/mesg-foundation","followers_url":"https://api.github.com/users/mesg-foundation/followers","following_url":"https://api.github.com/users/mesg-foundation/following{/other_user}","gists_url":"https://api.github.com/users/mesg-foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/mesg-foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesg-foundation/subscriptions","organizations_url":"https://api.github.com/users/mesg-foundation/orgs","repos_url":"https://api.github.com/users/mesg-foundation/repos","events_url":"https://api.github.com/users/mesg-foundation/events{/privacy}","received_events_url":"https://api.github.com/users/mesg-foundation/received_events","type":"Organization","site_admin":false},"repo":{"id":121732267,"name":"core","full_name":"mesg-foundation/core","owner":{"login":"mesg-foundation","id":34158802,"avatar_url":"https://avatars1.githubusercontent.com/u/34158802?v=4","gravatar_id":"","url":"https://api.github.com/users/mesg-foundation","html_url":"https://github.com/mesg-foundation","followers_url":"https://api.github.com/users/mesg-foundation/followers","following_url":"https://api.github.com/users/mesg-foundation/following{/other_user}","gists_url":"https://api.github.com/users/mesg-foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/mesg-foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesg-foundation/subscriptions","organizations_url":"https://api.github.com/users/mesg-foundation/orgs","repos_url":"https://api.github.com/users/mesg-foundation/repos","events_url":"https://api.github.com/users/mesg-foundation/events{/privacy}","received_events_url":"https://api.github.com/users/mesg-foundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesg-foundation/core","description":null,"fork":false,"url":"https://api.github.com/repos/mesg-foundation/core","forks_url":"https://api.github.com/repos/mesg-foundation/core/forks","keys_url":"https://api.github.com/repos/mesg-foundation/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesg-foundation/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesg-foundation/core/teams","hooks_url":"https://api.github.com/repos/mesg-foundation/core/hooks","issue_events_url":"https://api.github.com/repos/mesg-foundation/core/issues/events{/number}","events_url":"https://api.github.com/repos/mesg-foundation/core/events","assignees_url":"https://api.github.com/repos/mesg-foundation/core/assignees{/user}","branches_url":"https://api.github.com/repos/mesg-foundation/core/branches{/branch}","tags_url":"https://api.github.com/repos/mesg-foundation/core/tags","blobs_url":"https://api.github.com/repos/mesg-foundation/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesg-foundation/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesg-foundation/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesg-foundation/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesg-foundation/core/statuses/{sha}","languages_url":"https://api.github.com/repos/mesg-foundation/core/languages","stargazers_url":"https://api.github.com/repos/mesg-foundation/core/stargazers","contributors_url":"https://api.github.com/repos/mesg-foundation/core/contributors","subscribers_url":"https://api.github.com/repos/mesg-foundation/core/subscribers","subscription_url":"https://api.github.com/repos/mesg-foundation/core/subscription","commits_url":"https://api.github.com/repos/mesg-foundation/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesg-foundation/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesg-foundation/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesg-foundation/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesg-foundation/core/contents/{+path}","compare_url":"https://api.github.com/repos/mesg-foundation/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesg-foundation/core/merges","archive_url":"https://api.github.com/repos/mesg-foundation/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesg-foundation/core/downloads","issues_url":"https://api.github.com/repos/mesg-foundation/core/issues{/number}","pulls_url":"https://api.github.com/repos/mesg-foundation/core/pulls{/number}","milestones_url":"https://api.github.com/repos/mesg-foundation/core/milestones{/number}","notifications_url":"https://api.github.com/repos/mesg-foundation/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesg-foundation/core/labels{/name}","releases_url":"https://api.github.com/repos/mesg-foundation/core/releases{/id}","deployments_url":"https://api.github.com/repos/mesg-foundation/core/deployments","created_at":"2018-02-16T09:13:42Z","updated_at":"2018-05-29T18:25:38Z","pushed_at":"2018-05-30T04:00:42Z","git_url":"git://github.com/mesg-foundation/core.git","ssh_url":"git@github.com:mesg-foundation/core.git","clone_url":"https://github.com/mesg-foundation/core.git","svn_url":"https://github.com/mesg-foundation/core","homepage":"https://docs.mesg.tech/","size":817,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":44,"watchers":7,"default_branch":"dev"}},"base":{"label":"mesg-foundation:dev","ref":"dev","sha":"6f565a02a67cdea7e222fc589d4dbe9dd9e75845","user":{"login":"mesg-foundation","id":34158802,"avatar_url":"https://avatars1.githubusercontent.com/u/34158802?v=4","gravatar_id":"","url":"https://api.github.com/users/mesg-foundation","html_url":"https://github.com/mesg-foundation","followers_url":"https://api.github.com/users/mesg-foundation/followers","following_url":"https://api.github.com/users/mesg-foundation/following{/other_user}","gists_url":"https://api.github.com/users/mesg-foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/mesg-foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesg-foundation/subscriptions","organizations_url":"https://api.github.com/users/mesg-foundation/orgs","repos_url":"https://api.github.com/users/mesg-foundation/repos","events_url":"https://api.github.com/users/mesg-foundation/events{/privacy}","received_events_url":"https://api.github.com/users/mesg-foundation/received_events","type":"Organization","site_admin":false},"repo":{"id":121732267,"name":"core","full_name":"mesg-foundation/core","owner":{"login":"mesg-foundation","id":34158802,"avatar_url":"https://avatars1.githubusercontent.com/u/34158802?v=4","gravatar_id":"","url":"https://api.github.com/users/mesg-foundation","html_url":"https://github.com/mesg-foundation","followers_url":"https://api.github.com/users/mesg-foundation/followers","following_url":"https://api.github.com/users/mesg-foundation/following{/other_user}","gists_url":"https://api.github.com/users/mesg-foundation/gists{/gist_id}","starred_url":"https://api.github.com/users/mesg-foundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesg-foundation/subscriptions","organizations_url":"https://api.github.com/users/mesg-foundation/orgs","repos_url":"https://api.github.com/users/mesg-foundation/repos","events_url":"https://api.github.com/users/mesg-foundation/events{/privacy}","received_events_url":"https://api.github.com/users/mesg-foundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesg-foundation/core","description":null,"fork":false,"url":"https://api.github.com/repos/mesg-foundation/core","forks_url":"https://api.github.com/repos/mesg-foundation/core/forks","keys_url":"https://api.github.com/repos/mesg-foundation/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesg-foundation/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesg-foundation/core/teams","hooks_url":"https://api.github.com/repos/mesg-foundation/core/hooks","issue_events_url":"https://api.github.com/repos/mesg-foundation/core/issues/events{/number}","events_url":"https://api.github.com/repos/mesg-foundation/core/events","assignees_url":"https://api.github.com/repos/mesg-foundation/core/assignees{/user}","branches_url":"https://api.github.com/repos/mesg-foundation/core/branches{/branch}","tags_url":"https://api.github.com/repos/mesg-foundation/core/tags","blobs_url":"https://api.github.com/repos/mesg-foundation/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesg-foundation/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesg-foundation/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesg-foundation/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesg-foundation/core/statuses/{sha}","languages_url":"https://api.github.com/repos/mesg-foundation/core/languages","stargazers_url":"https://api.github.com/repos/mesg-foundation/core/stargazers","contributors_url":"https://api.github.com/repos/mesg-foundation/core/contributors","subscribers_url":"https://api.github.com/repos/mesg-foundation/core/subscribers","subscription_url":"https://api.github.com/repos/mesg-foundation/core/subscription","commits_url":"https://api.github.com/repos/mesg-foundation/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesg-foundation/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesg-foundation/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesg-foundation/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesg-foundation/core/contents/{+path}","compare_url":"https://api.github.com/repos/mesg-foundation/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesg-foundation/core/merges","archive_url":"https://api.github.com/repos/mesg-foundation/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesg-foundation/core/downloads","issues_url":"https://api.github.com/repos/mesg-foundation/core/issues{/number}","pulls_url":"https://api.github.com/repos/mesg-foundation/core/pulls{/number}","milestones_url":"https://api.github.com/repos/mesg-foundation/core/milestones{/number}","notifications_url":"https://api.github.com/repos/mesg-foundation/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesg-foundation/core/labels{/name}","releases_url":"https://api.github.com/repos/mesg-foundation/core/releases{/id}","deployments_url":"https://api.github.com/repos/mesg-foundation/core/deployments","created_at":"2018-02-16T09:13:42Z","updated_at":"2018-05-29T18:25:38Z","pushed_at":"2018-05-30T04:00:42Z","git_url":"git://github.com/mesg-foundation/core.git","ssh_url":"git@github.com:mesg-foundation/core.git","clone_url":"https://github.com/mesg-foundation/core.git","svn_url":"https://github.com/mesg-foundation/core","homepage":"https://docs.mesg.tech/","size":817,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":44,"watchers":7,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/mesg-foundation/core/pulls/169"},"html":{"href":"https://github.com/mesg-foundation/core/pull/169"},"issue":{"href":"https://api.github.com/repos/mesg-foundation/core/issues/169"},"comments":{"href":"https://api.github.com/repos/mesg-foundation/core/issues/169/comments"},"review_comments":{"href":"https://api.github.com/repos/mesg-foundation/core/pulls/169/comments"},"review_comment":{"href":"https://api.github.com/repos/mesg-foundation/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesg-foundation/core/pulls/169/commits"},"statuses":{"href":"https://api.github.com/repos/mesg-foundation/core/statuses/def68e112a212d5204d04495d92f62e1c100537b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"antho1404"}}