{"action":"created","comment":{"url":"https://api.github.com/repos/mainflux/mainflux/pulls/comments/191192550","pull_request_review_id":123700682,"id":191192550,"diff_hunk":"@@ -0,0 +1,179 @@\n+package cmd\n+\n+import (\n+\t\"encoding/json\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"net/http\"\n+\t\"strconv\"\n+\t\"strings\"\n+\n+\t\"github.com/mainflux/mainflux/things\"\n+\t\"github.com/spf13/cobra\"\n+)\n+\n+var chanEndPoint = \"channels\"\n+\n+var cmdChannels = []cobra.Command{\n+\tcobra.Command{\n+\t\tUse:   \"create\",\n+\t\tShort: \"create <JSON_channel> <user_auth_token>\",\n+\t\tLong:  `Creates new channel and generates it's UUID`,\n+\t\tRun: func(cmdCobra *cobra.Command, args []string) {\n+\t\t\tif len(args) == 2 {\n+\t\t\t\tmsg := args[0]\n+\t\t\t\ttoken := args[1]\n+\t\t\t\tCreateChannel(msg, token)\n+\t\t\t} else {\n+\t\t\t\tLogUsage(cmdCobra.Short)\n+\t\t\t}\n+\t\t},\n+\t},\n+\tcobra.Command{\n+\t\tUse:   \"get\",\n+\t\tShort: \"get <user_auth_token> or get <channel_id> <user_auth_token>\",\n+\t\tLong:  `Gets list of all channels or gets channel by id`,\n+\t\tRun: func(cmdCobra *cobra.Command, args []string) {\n+\t\t\tif len(args) == 1 {\n+\t\t\t\tGetChannels(args[0])\n+\t\t\t} else if len(args) == 2 {\n+\t\t\t\tGetChannel(args[0], args[1])\n+\t\t\t} else {\n+\t\t\t\tLogUsage(cmdCobra.Short)\n+\t\t\t}\n+\t\t},\n+\t},\n+\tcobra.Command{\n+\t\tUse:   \"update\",\n+\t\tShort: \"update <channel_id> <JSON_string> <user_auth_token>\",\n+\t\tLong:  `Updates channel record`,\n+\t\tRun: func(cmdCobra *cobra.Command, args []string) {\n+\t\t\tif len(args) == 3 {\n+\t\t\t\tUpdateChannel(args[0], args[1], args[2])\n+\t\t\t} else {\n+\t\t\t\tLogUsage(cmdCobra.Short)\n+\t\t\t}\n+\t\t},\n+\t},\n+\tcobra.Command{\n+\t\tUse:   \"delete\",\n+\t\tShort: \"delete <channel_id> <user_auth_token>\",\n+\t\tLong:  `Delete channel by ID`,\n+\t\tRun: func(cmdCobra *cobra.Command, args []string) {\n+\t\t\tif len(args) == 2 {\n+\t\t\t\tif args[0] == \"all\" {\n+\t\t\t\t\tDeleteAllChannels(args[1])\n+\t\t\t\t} else {\n+\t\t\t\t\tDeleteChannel(args[0], args[1])\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tLogUsage(cmdCobra.Short)\n+\t\t\t}\n+\t\t},\n+\t},\n+}\n+\n+func NewChannelsCmd() *cobra.Command {\n+\tcmd := cobra.Command{\n+\t\tUse:   \"channels\",\n+\t\tShort: \"Manipulation with channels\",\n+\t\tLong:  `Manipulation with channels: create, delete or update channels`,\n+\t\tRun: func(cmdCobra *cobra.Command, args []string) {","path":"bashflux/channels.go","position":81,"original_position":81,"commit_id":"d329c6103b0beefdd4b1b65b7772d89a321a48a2","original_commit_id":"d329c6103b0beefdd4b1b65b7772d89a321a48a2","user":{"login":"anovakovic01","id":16108178,"avatar_url":"https://avatars2.githubusercontent.com/u/16108178?v=4","gravatar_id":"","url":"https://api.github.com/users/anovakovic01","html_url":"https://github.com/anovakovic01","followers_url":"https://api.github.com/users/anovakovic01/followers","following_url":"https://api.github.com/users/anovakovic01/following{/other_user}","gists_url":"https://api.github.com/users/anovakovic01/gists{/gist_id}","starred_url":"https://api.github.com/users/anovakovic01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anovakovic01/subscriptions","organizations_url":"https://api.github.com/users/anovakovic01/orgs","repos_url":"https://api.github.com/users/anovakovic01/repos","events_url":"https://api.github.com/users/anovakovic01/events{/privacy}","received_events_url":"https://api.github.com/users/anovakovic01/received_events","type":"User","site_admin":false},"body":"Rename to `cmd`.","created_at":"2018-05-28T12:20:46Z","updated_at":"2018-05-28T12:50:10Z","html_url":"https://github.com/mainflux/mainflux/pull/308#discussion_r191192550","pull_request_url":"https://api.github.com/repos/mainflux/mainflux/pulls/308","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mainflux/mainflux/pulls/comments/191192550"},"html":{"href":"https://github.com/mainflux/mainflux/pull/308#discussion_r191192550"},"pull_request":{"href":"https://api.github.com/repos/mainflux/mainflux/pulls/308"}}},"pull_request":{"url":"https://api.github.com/repos/mainflux/mainflux/pulls/308","id":190617346,"html_url":"https://github.com/mainflux/mainflux/pull/308","diff_url":"https://github.com/mainflux/mainflux/pull/308.diff","patch_url":"https://github.com/mainflux/mainflux/pull/308.patch","issue_url":"https://api.github.com/repos/mainflux/mainflux/issues/308","number":308,"state":"open","locked":false,"title":" MF-216 - Integrate Bashflux into monorepo ","user":{"login":"manuIO","id":9677805,"avatar_url":"https://avatars2.githubusercontent.com/u/9677805?v=4","gravatar_id":"","url":"https://api.github.com/users/manuIO","html_url":"https://github.com/manuIO","followers_url":"https://api.github.com/users/manuIO/followers","following_url":"https://api.github.com/users/manuIO/following{/other_user}","gists_url":"https://api.github.com/users/manuIO/gists{/gist_id}","starred_url":"https://api.github.com/users/manuIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuIO/subscriptions","organizations_url":"https://api.github.com/users/manuIO/orgs","repos_url":"https://api.github.com/users/manuIO/repos","events_url":"https://api.github.com/users/manuIO/events{/privacy}","received_events_url":"https://api.github.com/users/manuIO/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-25T15:07:01Z","updated_at":"2018-05-28T12:50:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb71147e501f86e026f6bf906c6923483a60d88e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dusanb94","id":17817225,"avatar_url":"https://avatars0.githubusercontent.com/u/17817225?v=4","gravatar_id":"","url":"https://api.github.com/users/dusanb94","html_url":"https://github.com/dusanb94","followers_url":"https://api.github.com/users/dusanb94/followers","following_url":"https://api.github.com/users/dusanb94/following{/other_user}","gists_url":"https://api.github.com/users/dusanb94/gists{/gist_id}","starred_url":"https://api.github.com/users/dusanb94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dusanb94/subscriptions","organizations_url":"https://api.github.com/users/dusanb94/orgs","repos_url":"https://api.github.com/users/dusanb94/repos","events_url":"https://api.github.com/users/dusanb94/events{/privacy}","received_events_url":"https://api.github.com/users/dusanb94/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mainflux/mainflux/pulls/308/commits","review_comments_url":"https://api.github.com/repos/mainflux/mainflux/pulls/308/comments","review_comment_url":"https://api.github.com/repos/mainflux/mainflux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mainflux/mainflux/issues/308/comments","statuses_url":"https://api.github.com/repos/mainflux/mainflux/statuses/d329c6103b0beefdd4b1b65b7772d89a321a48a2","head":{"label":"manuIO:master","ref":"master","sha":"d329c6103b0beefdd4b1b65b7772d89a321a48a2","user":{"login":"manuIO","id":9677805,"avatar_url":"https://avatars2.githubusercontent.com/u/9677805?v=4","gravatar_id":"","url":"https://api.github.com/users/manuIO","html_url":"https://github.com/manuIO","followers_url":"https://api.github.com/users/manuIO/followers","following_url":"https://api.github.com/users/manuIO/following{/other_user}","gists_url":"https://api.github.com/users/manuIO/gists{/gist_id}","starred_url":"https://api.github.com/users/manuIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuIO/subscriptions","organizations_url":"https://api.github.com/users/manuIO/orgs","repos_url":"https://api.github.com/users/manuIO/repos","events_url":"https://api.github.com/users/manuIO/events{/privacy}","received_events_url":"https://api.github.com/users/manuIO/received_events","type":"User","site_admin":false},"repo":{"id":134738302,"name":"mainflux","full_name":"manuIO/mainflux","owner":{"login":"manuIO","id":9677805,"avatar_url":"https://avatars2.githubusercontent.com/u/9677805?v=4","gravatar_id":"","url":"https://api.github.com/users/manuIO","html_url":"https://github.com/manuIO","followers_url":"https://api.github.com/users/manuIO/followers","following_url":"https://api.github.com/users/manuIO/following{/other_user}","gists_url":"https://api.github.com/users/manuIO/gists{/gist_id}","starred_url":"https://api.github.com/users/manuIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuIO/subscriptions","organizations_url":"https://api.github.com/users/manuIO/orgs","repos_url":"https://api.github.com/users/manuIO/repos","events_url":"https://api.github.com/users/manuIO/events{/privacy}","received_events_url":"https://api.github.com/users/manuIO/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manuIO/mainflux","description":"Industrial IoT Messaging and Device Management Server","fork":true,"url":"https://api.github.com/repos/manuIO/mainflux","forks_url":"https://api.github.com/repos/manuIO/mainflux/forks","keys_url":"https://api.github.com/repos/manuIO/mainflux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manuIO/mainflux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manuIO/mainflux/teams","hooks_url":"https://api.github.com/repos/manuIO/mainflux/hooks","issue_events_url":"https://api.github.com/repos/manuIO/mainflux/issues/events{/number}","events_url":"https://api.github.com/repos/manuIO/mainflux/events","assignees_url":"https://api.github.com/repos/manuIO/mainflux/assignees{/user}","branches_url":"https://api.github.com/repos/manuIO/mainflux/branches{/branch}","tags_url":"https://api.github.com/repos/manuIO/mainflux/tags","blobs_url":"https://api.github.com/repos/manuIO/mainflux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manuIO/mainflux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manuIO/mainflux/git/refs{/sha}","trees_url":"https://api.github.com/repos/manuIO/mainflux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manuIO/mainflux/statuses/{sha}","languages_url":"https://api.github.com/repos/manuIO/mainflux/languages","stargazers_url":"https://api.github.com/repos/manuIO/mainflux/stargazers","contributors_url":"https://api.github.com/repos/manuIO/mainflux/contributors","subscribers_url":"https://api.github.com/repos/manuIO/mainflux/subscribers","subscription_url":"https://api.github.com/repos/manuIO/mainflux/subscription","commits_url":"https://api.github.com/repos/manuIO/mainflux/commits{/sha}","git_commits_url":"https://api.github.com/repos/manuIO/mainflux/git/commits{/sha}","comments_url":"https://api.github.com/repos/manuIO/mainflux/comments{/number}","issue_comment_url":"https://api.github.com/repos/manuIO/mainflux/issues/comments{/number}","contents_url":"https://api.github.com/repos/manuIO/mainflux/contents/{+path}","compare_url":"https://api.github.com/repos/manuIO/mainflux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manuIO/mainflux/merges","archive_url":"https://api.github.com/repos/manuIO/mainflux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manuIO/mainflux/downloads","issues_url":"https://api.github.com/repos/manuIO/mainflux/issues{/number}","pulls_url":"https://api.github.com/repos/manuIO/mainflux/pulls{/number}","milestones_url":"https://api.github.com/repos/manuIO/mainflux/milestones{/number}","notifications_url":"https://api.github.com/repos/manuIO/mainflux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manuIO/mainflux/labels{/name}","releases_url":"https://api.github.com/repos/manuIO/mainflux/releases{/id}","deployments_url":"https://api.github.com/repos/manuIO/mainflux/deployments","created_at":"2018-05-24T15:58:29Z","updated_at":"2018-05-25T16:49:46Z","pushed_at":"2018-05-25T16:49:44Z","git_url":"git://github.com/manuIO/mainflux.git","ssh_url":"git@github.com:manuIO/mainflux.git","clone_url":"https://github.com/manuIO/mainflux.git","svn_url":"https://github.com/manuIO/mainflux","homepage":"","size":19363,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mainflux:master","ref":"master","sha":"ef3627f4eeb38334ce410d0d9176b0973ab87d5c","user":{"login":"mainflux","id":13207490,"avatar_url":"https://avatars1.githubusercontent.com/u/13207490?v=4","gravatar_id":"","url":"https://api.github.com/users/mainflux","html_url":"https://github.com/mainflux","followers_url":"https://api.github.com/users/mainflux/followers","following_url":"https://api.github.com/users/mainflux/following{/other_user}","gists_url":"https://api.github.com/users/mainflux/gists{/gist_id}","starred_url":"https://api.github.com/users/mainflux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mainflux/subscriptions","organizations_url":"https://api.github.com/users/mainflux/orgs","repos_url":"https://api.github.com/users/mainflux/repos","events_url":"https://api.github.com/users/mainflux/events{/privacy}","received_events_url":"https://api.github.com/users/mainflux/received_events","type":"Organization","site_admin":false},"repo":{"id":38644318,"name":"mainflux","full_name":"mainflux/mainflux","owner":{"login":"mainflux","id":13207490,"avatar_url":"https://avatars1.githubusercontent.com/u/13207490?v=4","gravatar_id":"","url":"https://api.github.com/users/mainflux","html_url":"https://github.com/mainflux","followers_url":"https://api.github.com/users/mainflux/followers","following_url":"https://api.github.com/users/mainflux/following{/other_user}","gists_url":"https://api.github.com/users/mainflux/gists{/gist_id}","starred_url":"https://api.github.com/users/mainflux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mainflux/subscriptions","organizations_url":"https://api.github.com/users/mainflux/orgs","repos_url":"https://api.github.com/users/mainflux/repos","events_url":"https://api.github.com/users/mainflux/events{/privacy}","received_events_url":"https://api.github.com/users/mainflux/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mainflux/mainflux","description":"Industrial IoT Messaging and Device Management Server","fork":false,"url":"https://api.github.com/repos/mainflux/mainflux","forks_url":"https://api.github.com/repos/mainflux/mainflux/forks","keys_url":"https://api.github.com/repos/mainflux/mainflux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mainflux/mainflux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mainflux/mainflux/teams","hooks_url":"https://api.github.com/repos/mainflux/mainflux/hooks","issue_events_url":"https://api.github.com/repos/mainflux/mainflux/issues/events{/number}","events_url":"https://api.github.com/repos/mainflux/mainflux/events","assignees_url":"https://api.github.com/repos/mainflux/mainflux/assignees{/user}","branches_url":"https://api.github.com/repos/mainflux/mainflux/branches{/branch}","tags_url":"https://api.github.com/repos/mainflux/mainflux/tags","blobs_url":"https://api.github.com/repos/mainflux/mainflux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mainflux/mainflux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mainflux/mainflux/git/refs{/sha}","trees_url":"https://api.github.com/repos/mainflux/mainflux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mainflux/mainflux/statuses/{sha}","languages_url":"https://api.github.com/repos/mainflux/mainflux/languages","stargazers_url":"https://api.github.com/repos/mainflux/mainflux/stargazers","contributors_url":"https://api.github.com/repos/mainflux/mainflux/contributors","subscribers_url":"https://api.github.com/repos/mainflux/mainflux/subscribers","subscription_url":"https://api.github.com/repos/mainflux/mainflux/subscription","commits_url":"https://api.github.com/repos/mainflux/mainflux/commits{/sha}","git_commits_url":"https://api.github.com/repos/mainflux/mainflux/git/commits{/sha}","comments_url":"https://api.github.com/repos/mainflux/mainflux/comments{/number}","issue_comment_url":"https://api.github.com/repos/mainflux/mainflux/issues/comments{/number}","contents_url":"https://api.github.com/repos/mainflux/mainflux/contents/{+path}","compare_url":"https://api.github.com/repos/mainflux/mainflux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mainflux/mainflux/merges","archive_url":"https://api.github.com/repos/mainflux/mainflux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mainflux/mainflux/downloads","issues_url":"https://api.github.com/repos/mainflux/mainflux/issues{/number}","pulls_url":"https://api.github.com/repos/mainflux/mainflux/pulls{/number}","milestones_url":"https://api.github.com/repos/mainflux/mainflux/milestones{/number}","notifications_url":"https://api.github.com/repos/mainflux/mainflux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mainflux/mainflux/labels{/name}","releases_url":"https://api.github.com/repos/mainflux/mainflux/releases{/id}","deployments_url":"https://api.github.com/repos/mainflux/mainflux/deployments","created_at":"2015-07-06T20:31:50Z","updated_at":"2018-05-28T10:47:23Z","pushed_at":"2018-05-28T12:19:25Z","git_url":"git://github.com/mainflux/mainflux.git","ssh_url":"git@github.com:mainflux/mainflux.git","clone_url":"https://github.com/mainflux/mainflux.git","svn_url":"https://github.com/mainflux/mainflux","homepage":"","size":19199,"stargazers_count":20,"watchers_count":20,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":22,"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":8,"open_issues":22,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mainflux/mainflux/pulls/308"},"html":{"href":"https://github.com/mainflux/mainflux/pull/308"},"issue":{"href":"https://api.github.com/repos/mainflux/mainflux/issues/308"},"comments":{"href":"https://api.github.com/repos/mainflux/mainflux/issues/308/comments"},"review_comments":{"href":"https://api.github.com/repos/mainflux/mainflux/pulls/308/comments"},"review_comment":{"href":"https://api.github.com/repos/mainflux/mainflux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mainflux/mainflux/pulls/308/commits"},"statuses":{"href":"https://api.github.com/repos/mainflux/mainflux/statuses/d329c6103b0beefdd4b1b65b7772d89a321a48a2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"anovakovic01"}}