{"action":"opened","number":528,"pull_request":{"url":"https://api.github.com/repos/shirou/gopsutil/pulls/528","id":189365991,"html_url":"https://github.com/shirou/gopsutil/pull/528","diff_url":"https://github.com/shirou/gopsutil/pull/528.diff","patch_url":"https://github.com/shirou/gopsutil/pull/528.patch","issue_url":"https://api.github.com/repos/shirou/gopsutil/issues/528","number":528,"state":"open","locked":false,"title":"[windows]services: add windows service feature","user":{"login":"pytimer","id":17105586,"avatar_url":"https://avatars0.githubusercontent.com/u/17105586?v=4","gravatar_id":"","url":"https://api.github.com/users/pytimer","html_url":"https://github.com/pytimer","followers_url":"https://api.github.com/users/pytimer/followers","following_url":"https://api.github.com/users/pytimer/following{/other_user}","gists_url":"https://api.github.com/users/pytimer/gists{/gist_id}","starred_url":"https://api.github.com/users/pytimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytimer/subscriptions","organizations_url":"https://api.github.com/users/pytimer/orgs","repos_url":"https://api.github.com/users/pytimer/repos","events_url":"https://api.github.com/users/pytimer/events{/privacy}","received_events_url":"https://api.github.com/users/pytimer/received_events","type":"User","site_admin":false},"body":"Hi, @shirou \r\nI write windows service package to implement like psutil win_services.\r\n\r\nusage:\r\n```go\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"log\"\r\n\r\n\t\"github.com/shirou/gopsutil/winservices\"\r\n)\r\n\r\nfunc main() {\r\n        name := \"MySQL57\"\r\n\tsrv, err := winservices.NewService(name)\r\n\tif err != nil {\r\n\t\tlog.Fatalf(\"get service by name error, %s\", err)\r\n\t}\r\n\tif err := srv.GetServiceDetail(); err != nil {\r\n\t\tlog.Fatalf(\"get service %s error, %s\", name, err)\r\n\t}\r\n\r\n       services, err := winservices.ListServices()\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n}\r\n```\r\n\r\nimplement #524, please check it.\r\nI don't know how to write test code for this feature, can you tell me?\r\nthanks :)","created_at":"2018-05-21T12:31:03Z","updated_at":"2018-05-21T12:31:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/shirou/gopsutil/pulls/528/commits","review_comments_url":"https://api.github.com/repos/shirou/gopsutil/pulls/528/comments","review_comment_url":"https://api.github.com/repos/shirou/gopsutil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shirou/gopsutil/issues/528/comments","statuses_url":"https://api.github.com/repos/shirou/gopsutil/statuses/ef5b2e4596f9ef3bf876b51363bd0c5f1436fa0b","head":{"label":"pytimer:win_services","ref":"win_services","sha":"ef5b2e4596f9ef3bf876b51363bd0c5f1436fa0b","user":{"login":"pytimer","id":17105586,"avatar_url":"https://avatars0.githubusercontent.com/u/17105586?v=4","gravatar_id":"","url":"https://api.github.com/users/pytimer","html_url":"https://github.com/pytimer","followers_url":"https://api.github.com/users/pytimer/followers","following_url":"https://api.github.com/users/pytimer/following{/other_user}","gists_url":"https://api.github.com/users/pytimer/gists{/gist_id}","starred_url":"https://api.github.com/users/pytimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytimer/subscriptions","organizations_url":"https://api.github.com/users/pytimer/orgs","repos_url":"https://api.github.com/users/pytimer/repos","events_url":"https://api.github.com/users/pytimer/events{/privacy}","received_events_url":"https://api.github.com/users/pytimer/received_events","type":"User","site_admin":false},"repo":{"id":134020406,"name":"gopsutil","full_name":"pytimer/gopsutil","owner":{"login":"pytimer","id":17105586,"avatar_url":"https://avatars0.githubusercontent.com/u/17105586?v=4","gravatar_id":"","url":"https://api.github.com/users/pytimer","html_url":"https://github.com/pytimer","followers_url":"https://api.github.com/users/pytimer/followers","following_url":"https://api.github.com/users/pytimer/following{/other_user}","gists_url":"https://api.github.com/users/pytimer/gists{/gist_id}","starred_url":"https://api.github.com/users/pytimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytimer/subscriptions","organizations_url":"https://api.github.com/users/pytimer/orgs","repos_url":"https://api.github.com/users/pytimer/repos","events_url":"https://api.github.com/users/pytimer/events{/privacy}","received_events_url":"https://api.github.com/users/pytimer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pytimer/gopsutil","description":"psutil for golang","fork":true,"url":"https://api.github.com/repos/pytimer/gopsutil","forks_url":"https://api.github.com/repos/pytimer/gopsutil/forks","keys_url":"https://api.github.com/repos/pytimer/gopsutil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytimer/gopsutil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytimer/gopsutil/teams","hooks_url":"https://api.github.com/repos/pytimer/gopsutil/hooks","issue_events_url":"https://api.github.com/repos/pytimer/gopsutil/issues/events{/number}","events_url":"https://api.github.com/repos/pytimer/gopsutil/events","assignees_url":"https://api.github.com/repos/pytimer/gopsutil/assignees{/user}","branches_url":"https://api.github.com/repos/pytimer/gopsutil/branches{/branch}","tags_url":"https://api.github.com/repos/pytimer/gopsutil/tags","blobs_url":"https://api.github.com/repos/pytimer/gopsutil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytimer/gopsutil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytimer/gopsutil/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytimer/gopsutil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytimer/gopsutil/statuses/{sha}","languages_url":"https://api.github.com/repos/pytimer/gopsutil/languages","stargazers_url":"https://api.github.com/repos/pytimer/gopsutil/stargazers","contributors_url":"https://api.github.com/repos/pytimer/gopsutil/contributors","subscribers_url":"https://api.github.com/repos/pytimer/gopsutil/subscribers","subscription_url":"https://api.github.com/repos/pytimer/gopsutil/subscription","commits_url":"https://api.github.com/repos/pytimer/gopsutil/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytimer/gopsutil/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytimer/gopsutil/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytimer/gopsutil/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytimer/gopsutil/contents/{+path}","compare_url":"https://api.github.com/repos/pytimer/gopsutil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytimer/gopsutil/merges","archive_url":"https://api.github.com/repos/pytimer/gopsutil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytimer/gopsutil/downloads","issues_url":"https://api.github.com/repos/pytimer/gopsutil/issues{/number}","pulls_url":"https://api.github.com/repos/pytimer/gopsutil/pulls{/number}","milestones_url":"https://api.github.com/repos/pytimer/gopsutil/milestones{/number}","notifications_url":"https://api.github.com/repos/pytimer/gopsutil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytimer/gopsutil/labels{/name}","releases_url":"https://api.github.com/repos/pytimer/gopsutil/releases{/id}","deployments_url":"https://api.github.com/repos/pytimer/gopsutil/deployments","created_at":"2018-05-19T01:51:09Z","updated_at":"2018-05-19T01:51:11Z","pushed_at":"2018-05-21T12:14:36Z","git_url":"git://github.com/pytimer/gopsutil.git","ssh_url":"git@github.com:pytimer/gopsutil.git","clone_url":"https://github.com/pytimer/gopsutil.git","svn_url":"https://github.com/pytimer/gopsutil","homepage":null,"size":1235,"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":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"shirou:master","ref":"master","sha":"cbf4fde1522d05c83ec4370cdc52d5c2ba1f2ed2","user":{"login":"shirou","id":177213,"avatar_url":"https://avatars1.githubusercontent.com/u/177213?v=4","gravatar_id":"","url":"https://api.github.com/users/shirou","html_url":"https://github.com/shirou","followers_url":"https://api.github.com/users/shirou/followers","following_url":"https://api.github.com/users/shirou/following{/other_user}","gists_url":"https://api.github.com/users/shirou/gists{/gist_id}","starred_url":"https://api.github.com/users/shirou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirou/subscriptions","organizations_url":"https://api.github.com/users/shirou/orgs","repos_url":"https://api.github.com/users/shirou/repos","events_url":"https://api.github.com/users/shirou/events{/privacy}","received_events_url":"https://api.github.com/users/shirou/received_events","type":"User","site_admin":false},"repo":{"id":18906266,"name":"gopsutil","full_name":"shirou/gopsutil","owner":{"login":"shirou","id":177213,"avatar_url":"https://avatars1.githubusercontent.com/u/177213?v=4","gravatar_id":"","url":"https://api.github.com/users/shirou","html_url":"https://github.com/shirou","followers_url":"https://api.github.com/users/shirou/followers","following_url":"https://api.github.com/users/shirou/following{/other_user}","gists_url":"https://api.github.com/users/shirou/gists{/gist_id}","starred_url":"https://api.github.com/users/shirou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirou/subscriptions","organizations_url":"https://api.github.com/users/shirou/orgs","repos_url":"https://api.github.com/users/shirou/repos","events_url":"https://api.github.com/users/shirou/events{/privacy}","received_events_url":"https://api.github.com/users/shirou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shirou/gopsutil","description":"psutil for golang","fork":false,"url":"https://api.github.com/repos/shirou/gopsutil","forks_url":"https://api.github.com/repos/shirou/gopsutil/forks","keys_url":"https://api.github.com/repos/shirou/gopsutil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shirou/gopsutil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shirou/gopsutil/teams","hooks_url":"https://api.github.com/repos/shirou/gopsutil/hooks","issue_events_url":"https://api.github.com/repos/shirou/gopsutil/issues/events{/number}","events_url":"https://api.github.com/repos/shirou/gopsutil/events","assignees_url":"https://api.github.com/repos/shirou/gopsutil/assignees{/user}","branches_url":"https://api.github.com/repos/shirou/gopsutil/branches{/branch}","tags_url":"https://api.github.com/repos/shirou/gopsutil/tags","blobs_url":"https://api.github.com/repos/shirou/gopsutil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shirou/gopsutil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shirou/gopsutil/git/refs{/sha}","trees_url":"https://api.github.com/repos/shirou/gopsutil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shirou/gopsutil/statuses/{sha}","languages_url":"https://api.github.com/repos/shirou/gopsutil/languages","stargazers_url":"https://api.github.com/repos/shirou/gopsutil/stargazers","contributors_url":"https://api.github.com/repos/shirou/gopsutil/contributors","subscribers_url":"https://api.github.com/repos/shirou/gopsutil/subscribers","subscription_url":"https://api.github.com/repos/shirou/gopsutil/subscription","commits_url":"https://api.github.com/repos/shirou/gopsutil/commits{/sha}","git_commits_url":"https://api.github.com/repos/shirou/gopsutil/git/commits{/sha}","comments_url":"https://api.github.com/repos/shirou/gopsutil/comments{/number}","issue_comment_url":"https://api.github.com/repos/shirou/gopsutil/issues/comments{/number}","contents_url":"https://api.github.com/repos/shirou/gopsutil/contents/{+path}","compare_url":"https://api.github.com/repos/shirou/gopsutil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shirou/gopsutil/merges","archive_url":"https://api.github.com/repos/shirou/gopsutil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shirou/gopsutil/downloads","issues_url":"https://api.github.com/repos/shirou/gopsutil/issues{/number}","pulls_url":"https://api.github.com/repos/shirou/gopsutil/pulls{/number}","milestones_url":"https://api.github.com/repos/shirou/gopsutil/milestones{/number}","notifications_url":"https://api.github.com/repos/shirou/gopsutil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shirou/gopsutil/labels{/name}","releases_url":"https://api.github.com/repos/shirou/gopsutil/releases{/id}","deployments_url":"https://api.github.com/repos/shirou/gopsutil/deployments","created_at":"2014-04-18T07:35:28Z","updated_at":"2018-05-21T08:00:32Z","pushed_at":"2018-05-19T04:26:04Z","git_url":"git://github.com/shirou/gopsutil.git","ssh_url":"git@github.com:shirou/gopsutil.git","clone_url":"https://github.com/shirou/gopsutil.git","svn_url":"https://github.com/shirou/gopsutil","homepage":null,"size":1238,"stargazers_count":2627,"watchers_count":2627,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":526,"mirror_url":null,"archived":false,"open_issues_count":64,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":526,"open_issues":64,"watchers":2627,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shirou/gopsutil/pulls/528"},"html":{"href":"https://github.com/shirou/gopsutil/pull/528"},"issue":{"href":"https://api.github.com/repos/shirou/gopsutil/issues/528"},"comments":{"href":"https://api.github.com/repos/shirou/gopsutil/issues/528/comments"},"review_comments":{"href":"https://api.github.com/repos/shirou/gopsutil/pulls/528/comments"},"review_comment":{"href":"https://api.github.com/repos/shirou/gopsutil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shirou/gopsutil/pulls/528/commits"},"statuses":{"href":"https://api.github.com/repos/shirou/gopsutil/statuses/ef5b2e4596f9ef3bf876b51363bd0c5f1436fa0b"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":215,"deletions":0,"changed_files":3}}
{"actor":{"display_login":"pytimer"}}