{"action":"created","comment":{"url":"https://api.github.com/repos/kardianos/service/pulls/comments/212029274","pull_request_review_id":148574605,"id":212029274,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjAyOTI3NA==","diff_hunk":"@@ -88,6 +88,23 @@ const (\n \toptionLaunchdConfig = \"LaunchdConfig\"\n )\n \n+// Status represents service status as an interger value\n+type Status int\n+\n+// Status of service represented as an integer\n+const (\n+\tStatusNotImplemented Status = iota\n+\tStatusUnknown\n+\tStatusError\n+\tStatusStarting","path":"service.go","position":12,"original_position":12,"commit_id":"9f7b06816c1754e08c0e2e2728c2e34619d301fb","original_commit_id":"9f7b06816c1754e08c0e2e2728c2e34619d301fb","user":{"login":"SteelPhase","id":2711058,"node_id":"MDQ6VXNlcjI3MTEwNTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2711058?v=4","gravatar_id":"","url":"https://api.github.com/users/SteelPhase","html_url":"https://github.com/SteelPhase","followers_url":"https://api.github.com/users/SteelPhase/followers","following_url":"https://api.github.com/users/SteelPhase/following{/other_user}","gists_url":"https://api.github.com/users/SteelPhase/gists{/gist_id}","starred_url":"https://api.github.com/users/SteelPhase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteelPhase/subscriptions","organizations_url":"https://api.github.com/users/SteelPhase/orgs","repos_url":"https://api.github.com/users/SteelPhase/repos","events_url":"https://api.github.com/users/SteelPhase/events{/privacy}","received_events_url":"https://api.github.com/users/SteelPhase/received_events","type":"User","site_admin":false},"body":"Is the goal of ORing StatusRunning and StatusPending for StatusStarting to be able to represent both states. The reason I ask, is if someone were to decide to use bitwise equality on Status both states would be true as it is right now\r\n\r\nI've added an `Is` function below to demonstrate what I mean.\r\n\r\n```golang\r\n// Status represents service status as an byte value\r\ntype Status byte\r\n\r\n// Status of service represented as an byte\r\nconst (\r\n\tStatusUnknown Status = 1 << iota\r\n\tStatusPending\r\n\tStatusRunning\r\n\tStatusPaused\r\n\tStatusContinue\r\n\tStatusStopped\r\n\tStatusStarting   = StatusRunning | StatusPending\r\n\tStatusPausing    = StatusPaused | StatusPending\r\n\tStatusContinuing = StatusContinue | StatusPending\r\n\tStatusStopping   = StatusStopped | StatusPending\r\n)\r\n\r\n// Is returns true if the Status is the provided Status\r\nfunc (s Status) Is(s2 Status) bool {\r\n\treturn s&s2 == s2\r\n}\r\n```","created_at":"2018-08-22T16:52:25Z","updated_at":"2018-08-22T16:52:25Z","html_url":"https://github.com/kardianos/service/pull/143#discussion_r212029274","pull_request_url":"https://api.github.com/repos/kardianos/service/pulls/143","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kardianos/service/pulls/comments/212029274"},"html":{"href":"https://github.com/kardianos/service/pull/143#discussion_r212029274"},"pull_request":{"href":"https://api.github.com/repos/kardianos/service/pulls/143"}},"in_reply_to_id":211736915},"pull_request":{"url":"https://api.github.com/repos/kardianos/service/pulls/143","id":209929967,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5OTI5OTY3","html_url":"https://github.com/kardianos/service/pull/143","diff_url":"https://github.com/kardianos/service/pull/143.diff","patch_url":"https://github.com/kardianos/service/pull/143.patch","issue_url":"https://api.github.com/repos/kardianos/service/issues/143","number":143,"state":"open","locked":false,"title":"Add support for retrieving service status","user":{"login":"SteelPhase","id":2711058,"node_id":"MDQ6VXNlcjI3MTEwNTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2711058?v=4","gravatar_id":"","url":"https://api.github.com/users/SteelPhase","html_url":"https://github.com/SteelPhase","followers_url":"https://api.github.com/users/SteelPhase/followers","following_url":"https://api.github.com/users/SteelPhase/following{/other_user}","gists_url":"https://api.github.com/users/SteelPhase/gists{/gist_id}","starred_url":"https://api.github.com/users/SteelPhase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteelPhase/subscriptions","organizations_url":"https://api.github.com/users/SteelPhase/orgs","repos_url":"https://api.github.com/users/SteelPhase/repos","events_url":"https://api.github.com/users/SteelPhase/events{/privacy}","received_events_url":"https://api.github.com/users/SteelPhase/received_events","type":"User","site_admin":false},"body":"This is a pretty naive approach to fetching service status, but systemd, upstart, sysv, launchd, and windows will all return some level of detail.\r\n\r\nLaunchd doesn't appear to give any meaningful information for services that aren't running.","created_at":"2018-08-21T19:23:42Z","updated_at":"2018-08-22T16:52:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c4eedf753d6808b4ae0eca5a8aff29f6555c1a2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kardianos/service/pulls/143/commits","review_comments_url":"https://api.github.com/repos/kardianos/service/pulls/143/comments","review_comment_url":"https://api.github.com/repos/kardianos/service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kardianos/service/issues/143/comments","statuses_url":"https://api.github.com/repos/kardianos/service/statuses/9f7b06816c1754e08c0e2e2728c2e34619d301fb","head":{"label":"SteelPhase:status-support","ref":"status-support","sha":"9f7b06816c1754e08c0e2e2728c2e34619d301fb","user":{"login":"SteelPhase","id":2711058,"node_id":"MDQ6VXNlcjI3MTEwNTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2711058?v=4","gravatar_id":"","url":"https://api.github.com/users/SteelPhase","html_url":"https://github.com/SteelPhase","followers_url":"https://api.github.com/users/SteelPhase/followers","following_url":"https://api.github.com/users/SteelPhase/following{/other_user}","gists_url":"https://api.github.com/users/SteelPhase/gists{/gist_id}","starred_url":"https://api.github.com/users/SteelPhase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteelPhase/subscriptions","organizations_url":"https://api.github.com/users/SteelPhase/orgs","repos_url":"https://api.github.com/users/SteelPhase/repos","events_url":"https://api.github.com/users/SteelPhase/events{/privacy}","received_events_url":"https://api.github.com/users/SteelPhase/received_events","type":"User","site_admin":false},"repo":{"id":145018289,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUwMTgyODk=","name":"service","full_name":"SteelPhase/service","owner":{"login":"SteelPhase","id":2711058,"node_id":"MDQ6VXNlcjI3MTEwNTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2711058?v=4","gravatar_id":"","url":"https://api.github.com/users/SteelPhase","html_url":"https://github.com/SteelPhase","followers_url":"https://api.github.com/users/SteelPhase/followers","following_url":"https://api.github.com/users/SteelPhase/following{/other_user}","gists_url":"https://api.github.com/users/SteelPhase/gists{/gist_id}","starred_url":"https://api.github.com/users/SteelPhase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteelPhase/subscriptions","organizations_url":"https://api.github.com/users/SteelPhase/orgs","repos_url":"https://api.github.com/users/SteelPhase/repos","events_url":"https://api.github.com/users/SteelPhase/events{/privacy}","received_events_url":"https://api.github.com/users/SteelPhase/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SteelPhase/service","description":"Run go programs as a service on major platforms.","fork":true,"url":"https://api.github.com/repos/SteelPhase/service","forks_url":"https://api.github.com/repos/SteelPhase/service/forks","keys_url":"https://api.github.com/repos/SteelPhase/service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SteelPhase/service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SteelPhase/service/teams","hooks_url":"https://api.github.com/repos/SteelPhase/service/hooks","issue_events_url":"https://api.github.com/repos/SteelPhase/service/issues/events{/number}","events_url":"https://api.github.com/repos/SteelPhase/service/events","assignees_url":"https://api.github.com/repos/SteelPhase/service/assignees{/user}","branches_url":"https://api.github.com/repos/SteelPhase/service/branches{/branch}","tags_url":"https://api.github.com/repos/SteelPhase/service/tags","blobs_url":"https://api.github.com/repos/SteelPhase/service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SteelPhase/service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SteelPhase/service/git/refs{/sha}","trees_url":"https://api.github.com/repos/SteelPhase/service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SteelPhase/service/statuses/{sha}","languages_url":"https://api.github.com/repos/SteelPhase/service/languages","stargazers_url":"https://api.github.com/repos/SteelPhase/service/stargazers","contributors_url":"https://api.github.com/repos/SteelPhase/service/contributors","subscribers_url":"https://api.github.com/repos/SteelPhase/service/subscribers","subscription_url":"https://api.github.com/repos/SteelPhase/service/subscription","commits_url":"https://api.github.com/repos/SteelPhase/service/commits{/sha}","git_commits_url":"https://api.github.com/repos/SteelPhase/service/git/commits{/sha}","comments_url":"https://api.github.com/repos/SteelPhase/service/comments{/number}","issue_comment_url":"https://api.github.com/repos/SteelPhase/service/issues/comments{/number}","contents_url":"https://api.github.com/repos/SteelPhase/service/contents/{+path}","compare_url":"https://api.github.com/repos/SteelPhase/service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SteelPhase/service/merges","archive_url":"https://api.github.com/repos/SteelPhase/service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SteelPhase/service/downloads","issues_url":"https://api.github.com/repos/SteelPhase/service/issues{/number}","pulls_url":"https://api.github.com/repos/SteelPhase/service/pulls{/number}","milestones_url":"https://api.github.com/repos/SteelPhase/service/milestones{/number}","notifications_url":"https://api.github.com/repos/SteelPhase/service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SteelPhase/service/labels{/name}","releases_url":"https://api.github.com/repos/SteelPhase/service/releases{/id}","deployments_url":"https://api.github.com/repos/SteelPhase/service/deployments","created_at":"2018-08-16T17:15:17Z","updated_at":"2018-08-16T17:15:19Z","pushed_at":"2018-08-21T19:14:55Z","git_url":"git://github.com/SteelPhase/service.git","ssh_url":"git@github.com:SteelPhase/service.git","clone_url":"https://github.com/SteelPhase/service.git","svn_url":"https://github.com/SteelPhase/service","homepage":null,"size":3705,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"zlib","name":"zlib License","spdx_id":"Zlib","url":"https://api.github.com/licenses/zlib","node_id":"MDc6TGljZW5zZTI3"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kardianos:master","ref":"master","sha":"4cdeddd6f419cb717c4234a9566405565fcfcae7","user":{"login":"kardianos","id":755121,"node_id":"MDQ6VXNlcjc1NTEyMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/755121?v=4","gravatar_id":"","url":"https://api.github.com/users/kardianos","html_url":"https://github.com/kardianos","followers_url":"https://api.github.com/users/kardianos/followers","following_url":"https://api.github.com/users/kardianos/following{/other_user}","gists_url":"https://api.github.com/users/kardianos/gists{/gist_id}","starred_url":"https://api.github.com/users/kardianos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kardianos/subscriptions","organizations_url":"https://api.github.com/users/kardianos/orgs","repos_url":"https://api.github.com/users/kardianos/repos","events_url":"https://api.github.com/users/kardianos/events{/privacy}","received_events_url":"https://api.github.com/users/kardianos/received_events","type":"User","site_admin":false},"repo":{"id":28838478,"node_id":"MDEwOlJlcG9zaXRvcnkyODgzODQ3OA==","name":"service","full_name":"kardianos/service","owner":{"login":"kardianos","id":755121,"node_id":"MDQ6VXNlcjc1NTEyMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/755121?v=4","gravatar_id":"","url":"https://api.github.com/users/kardianos","html_url":"https://github.com/kardianos","followers_url":"https://api.github.com/users/kardianos/followers","following_url":"https://api.github.com/users/kardianos/following{/other_user}","gists_url":"https://api.github.com/users/kardianos/gists{/gist_id}","starred_url":"https://api.github.com/users/kardianos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kardianos/subscriptions","organizations_url":"https://api.github.com/users/kardianos/orgs","repos_url":"https://api.github.com/users/kardianos/repos","events_url":"https://api.github.com/users/kardianos/events{/privacy}","received_events_url":"https://api.github.com/users/kardianos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kardianos/service","description":"Run go programs as a service on major platforms.","fork":false,"url":"https://api.github.com/repos/kardianos/service","forks_url":"https://api.github.com/repos/kardianos/service/forks","keys_url":"https://api.github.com/repos/kardianos/service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kardianos/service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kardianos/service/teams","hooks_url":"https://api.github.com/repos/kardianos/service/hooks","issue_events_url":"https://api.github.com/repos/kardianos/service/issues/events{/number}","events_url":"https://api.github.com/repos/kardianos/service/events","assignees_url":"https://api.github.com/repos/kardianos/service/assignees{/user}","branches_url":"https://api.github.com/repos/kardianos/service/branches{/branch}","tags_url":"https://api.github.com/repos/kardianos/service/tags","blobs_url":"https://api.github.com/repos/kardianos/service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kardianos/service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kardianos/service/git/refs{/sha}","trees_url":"https://api.github.com/repos/kardianos/service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kardianos/service/statuses/{sha}","languages_url":"https://api.github.com/repos/kardianos/service/languages","stargazers_url":"https://api.github.com/repos/kardianos/service/stargazers","contributors_url":"https://api.github.com/repos/kardianos/service/contributors","subscribers_url":"https://api.github.com/repos/kardianos/service/subscribers","subscription_url":"https://api.github.com/repos/kardianos/service/subscription","commits_url":"https://api.github.com/repos/kardianos/service/commits{/sha}","git_commits_url":"https://api.github.com/repos/kardianos/service/git/commits{/sha}","comments_url":"https://api.github.com/repos/kardianos/service/comments{/number}","issue_comment_url":"https://api.github.com/repos/kardianos/service/issues/comments{/number}","contents_url":"https://api.github.com/repos/kardianos/service/contents/{+path}","compare_url":"https://api.github.com/repos/kardianos/service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kardianos/service/merges","archive_url":"https://api.github.com/repos/kardianos/service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kardianos/service/downloads","issues_url":"https://api.github.com/repos/kardianos/service/issues{/number}","pulls_url":"https://api.github.com/repos/kardianos/service/pulls{/number}","milestones_url":"https://api.github.com/repos/kardianos/service/milestones{/number}","notifications_url":"https://api.github.com/repos/kardianos/service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kardianos/service/labels{/name}","releases_url":"https://api.github.com/repos/kardianos/service/releases{/id}","deployments_url":"https://api.github.com/repos/kardianos/service/deployments","created_at":"2015-01-06T00:12:22Z","updated_at":"2018-08-22T09:06:53Z","pushed_at":"2018-08-21T19:23:43Z","git_url":"git://github.com/kardianos/service.git","ssh_url":"git@github.com:kardianos/service.git","clone_url":"https://github.com/kardianos/service.git","svn_url":"https://github.com/kardianos/service","homepage":null,"size":3703,"stargazers_count":1427,"watchers_count":1427,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":226,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"zlib","name":"zlib License","spdx_id":"Zlib","url":"https://api.github.com/licenses/zlib","node_id":"MDc6TGljZW5zZTI3"},"forks":226,"open_issues":45,"watchers":1427,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kardianos/service/pulls/143"},"html":{"href":"https://github.com/kardianos/service/pull/143"},"issue":{"href":"https://api.github.com/repos/kardianos/service/issues/143"},"comments":{"href":"https://api.github.com/repos/kardianos/service/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/kardianos/service/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/kardianos/service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kardianos/service/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/kardianos/service/statuses/9f7b06816c1754e08c0e2e2728c2e34619d301fb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"SteelPhase"}}