{"action":"created","comment":{"url":"https://api.github.com/repos/pkg/sftp/pulls/comments/73084146","id":73084146,"diff_hunk":"@@ -0,0 +1,244 @@\n+package sftp\n+\n+import (\n+\t\"io\"\n+\t\"os\"\n+\t\"path\"\n+\t\"path/filepath\"\n+\t\"sync\"\n+\t\"syscall\"\n+)\n+\n+// Request contains the data and state for the incoming service request.\n+type Request struct {\n+\t// Get, Put, SetStat, Stat, Rename, Remove\n+\t// Rmdir, Mkdir, List, Readlink, Symlink\n+\tMethod   string\n+\tFilepath string\n+\tAttrs    []byte // convert to sub-struct\n+\tTarget   string // for renames and sym-links\n+\t// packet data\n+\tpackets     []packet_data\n+\tpacketsLock sync.RWMutex\n+\t// reader/writer from handlers\n+\tput_writer io.WriterAt\n+\tget_reader io.ReaderAt\n+\teof        bool // hack for readdir to keep eof state\n+}\n+\n+type packet_data struct {","path":"request.go","position":29,"original_position":29,"commit_id":"00927fb459ff7e2a70dd12903a5554ca2b2cfe0c","original_commit_id":"00927fb459ff7e2a70dd12903a5554ca2b2cfe0c","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"don't use underscores in Go names; type packet_data should be packetData","created_at":"2016-08-02T02:08:35Z","updated_at":"2016-08-02T02:08:35Z","html_url":"https://github.com/pkg/sftp/pull/129#discussion_r73084146","pull_request_url":"https://api.github.com/repos/pkg/sftp/pulls/129","_links":{"self":{"href":"https://api.github.com/repos/pkg/sftp/pulls/comments/73084146"},"html":{"href":"https://github.com/pkg/sftp/pull/129#discussion_r73084146"},"pull_request":{"href":"https://api.github.com/repos/pkg/sftp/pulls/129"}}},"pull_request":{"url":"https://api.github.com/repos/pkg/sftp/pulls/129","id":79666001,"html_url":"https://github.com/pkg/sftp/pull/129","diff_url":"https://github.com/pkg/sftp/pull/129.diff","patch_url":"https://github.com/pkg/sftp/pull/129.patch","issue_url":"https://api.github.com/repos/pkg/sftp/issues/129","number":129,"state":"open","locked":false,"title":"Request based server","user":{"login":"eikenb","id":722663,"avatar_url":"https://avatars.githubusercontent.com/u/722663?v=3","gravatar_id":"","url":"https://api.github.com/users/eikenb","html_url":"https://github.com/eikenb","followers_url":"https://api.github.com/users/eikenb/followers","following_url":"https://api.github.com/users/eikenb/following{/other_user}","gists_url":"https://api.github.com/users/eikenb/gists{/gist_id}","starred_url":"https://api.github.com/users/eikenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eikenb/subscriptions","organizations_url":"https://api.github.com/users/eikenb/orgs","repos_url":"https://api.github.com/users/eikenb/repos","events_url":"https://api.github.com/users/eikenb/events{/privacy}","received_events_url":"https://api.github.com/users/eikenb/received_events","type":"User","site_admin":false},"body":"Related ticket: #95 \r\n\r\nI've fixed the issues I found since PR #127 and added tests to cover them. This is the same code otherwise and below is the same note from it. If \r\n\r\nThis PR contains a request based API for extending the SFTP server with arbitrary backends. It was inspired by a mix of the net/http package and the linux inotify system. No existing code is touched, this only adds new code. This required a bit of duplication in places, but I wanted to leave the existing code as is. I specifically tried to make the Handlers code not into a general filesystem abstraction. It is very specific to the SFTP protocol and tries to be lightweight (with 4, 1 method interfaces).\r\n\r\nIt is mostly done including at least some documentation, examples, and tests. The files are all named starting with \"request\" as well as ./examples/request-server/main.go. The public method to create the new server is in request-server.go as are the worker threads, so it is a good place to start working through the code. The request-readme.md contains the initial docs which hopefully introduces how it is supposed to work.\r\n\r\nIf there are any changes you'd like to see or questions you have please let me know. Thanks.","created_at":"2016-08-02T02:08:23Z","updated_at":"2016-08-02T02:08:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f60d817b24b52680694cec2d935a3706f976ec0a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pkg/sftp/pulls/129/commits","review_comments_url":"https://api.github.com/repos/pkg/sftp/pulls/129/comments","review_comment_url":"https://api.github.com/repos/pkg/sftp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pkg/sftp/issues/129/comments","statuses_url":"https://api.github.com/repos/pkg/sftp/statuses/00927fb459ff7e2a70dd12903a5554ca2b2cfe0c","head":{"label":"eikenb:request","ref":"request","sha":"00927fb459ff7e2a70dd12903a5554ca2b2cfe0c","user":{"login":"eikenb","id":722663,"avatar_url":"https://avatars.githubusercontent.com/u/722663?v=3","gravatar_id":"","url":"https://api.github.com/users/eikenb","html_url":"https://github.com/eikenb","followers_url":"https://api.github.com/users/eikenb/followers","following_url":"https://api.github.com/users/eikenb/following{/other_user}","gists_url":"https://api.github.com/users/eikenb/gists{/gist_id}","starred_url":"https://api.github.com/users/eikenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eikenb/subscriptions","organizations_url":"https://api.github.com/users/eikenb/orgs","repos_url":"https://api.github.com/users/eikenb/repos","events_url":"https://api.github.com/users/eikenb/events{/privacy}","received_events_url":"https://api.github.com/users/eikenb/received_events","type":"User","site_admin":false},"repo":{"id":58231616,"name":"sftp","full_name":"eikenb/sftp","owner":{"login":"eikenb","id":722663,"avatar_url":"https://avatars.githubusercontent.com/u/722663?v=3","gravatar_id":"","url":"https://api.github.com/users/eikenb","html_url":"https://github.com/eikenb","followers_url":"https://api.github.com/users/eikenb/followers","following_url":"https://api.github.com/users/eikenb/following{/other_user}","gists_url":"https://api.github.com/users/eikenb/gists{/gist_id}","starred_url":"https://api.github.com/users/eikenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eikenb/subscriptions","organizations_url":"https://api.github.com/users/eikenb/orgs","repos_url":"https://api.github.com/users/eikenb/repos","events_url":"https://api.github.com/users/eikenb/events{/privacy}","received_events_url":"https://api.github.com/users/eikenb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eikenb/sftp","description":"Forked to work on an http/mux style server.","fork":true,"url":"https://api.github.com/repos/eikenb/sftp","forks_url":"https://api.github.com/repos/eikenb/sftp/forks","keys_url":"https://api.github.com/repos/eikenb/sftp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eikenb/sftp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eikenb/sftp/teams","hooks_url":"https://api.github.com/repos/eikenb/sftp/hooks","issue_events_url":"https://api.github.com/repos/eikenb/sftp/issues/events{/number}","events_url":"https://api.github.com/repos/eikenb/sftp/events","assignees_url":"https://api.github.com/repos/eikenb/sftp/assignees{/user}","branches_url":"https://api.github.com/repos/eikenb/sftp/branches{/branch}","tags_url":"https://api.github.com/repos/eikenb/sftp/tags","blobs_url":"https://api.github.com/repos/eikenb/sftp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eikenb/sftp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eikenb/sftp/git/refs{/sha}","trees_url":"https://api.github.com/repos/eikenb/sftp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eikenb/sftp/statuses/{sha}","languages_url":"https://api.github.com/repos/eikenb/sftp/languages","stargazers_url":"https://api.github.com/repos/eikenb/sftp/stargazers","contributors_url":"https://api.github.com/repos/eikenb/sftp/contributors","subscribers_url":"https://api.github.com/repos/eikenb/sftp/subscribers","subscription_url":"https://api.github.com/repos/eikenb/sftp/subscription","commits_url":"https://api.github.com/repos/eikenb/sftp/commits{/sha}","git_commits_url":"https://api.github.com/repos/eikenb/sftp/git/commits{/sha}","comments_url":"https://api.github.com/repos/eikenb/sftp/comments{/number}","issue_comment_url":"https://api.github.com/repos/eikenb/sftp/issues/comments{/number}","contents_url":"https://api.github.com/repos/eikenb/sftp/contents/{+path}","compare_url":"https://api.github.com/repos/eikenb/sftp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eikenb/sftp/merges","archive_url":"https://api.github.com/repos/eikenb/sftp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eikenb/sftp/downloads","issues_url":"https://api.github.com/repos/eikenb/sftp/issues{/number}","pulls_url":"https://api.github.com/repos/eikenb/sftp/pulls{/number}","milestones_url":"https://api.github.com/repos/eikenb/sftp/milestones{/number}","notifications_url":"https://api.github.com/repos/eikenb/sftp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eikenb/sftp/labels{/name}","releases_url":"https://api.github.com/repos/eikenb/sftp/releases{/id}","deployments_url":"https://api.github.com/repos/eikenb/sftp/deployments","created_at":"2016-05-06T19:56:40Z","updated_at":"2016-07-22T22:39:56Z","pushed_at":"2016-08-02T02:08:01Z","git_url":"git://github.com/eikenb/sftp.git","ssh_url":"git@github.com:eikenb/sftp.git","clone_url":"https://github.com/eikenb/sftp.git","svn_url":"https://github.com/eikenb/sftp","homepage":"","size":1694,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pkg:master","ref":"master","sha":"a71e8f580e3b622ebff585309160b1cc549ef4d2","user":{"login":"pkg","id":5497984,"avatar_url":"https://avatars.githubusercontent.com/u/5497984?v=3","gravatar_id":"","url":"https://api.github.com/users/pkg","html_url":"https://github.com/pkg","followers_url":"https://api.github.com/users/pkg/followers","following_url":"https://api.github.com/users/pkg/following{/other_user}","gists_url":"https://api.github.com/users/pkg/gists{/gist_id}","starred_url":"https://api.github.com/users/pkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkg/subscriptions","organizations_url":"https://api.github.com/users/pkg/orgs","repos_url":"https://api.github.com/users/pkg/repos","events_url":"https://api.github.com/users/pkg/events{/privacy}","received_events_url":"https://api.github.com/users/pkg/received_events","type":"Organization","site_admin":false},"repo":{"id":14132192,"name":"sftp","full_name":"pkg/sftp","owner":{"login":"pkg","id":5497984,"avatar_url":"https://avatars.githubusercontent.com/u/5497984?v=3","gravatar_id":"","url":"https://api.github.com/users/pkg","html_url":"https://github.com/pkg","followers_url":"https://api.github.com/users/pkg/followers","following_url":"https://api.github.com/users/pkg/following{/other_user}","gists_url":"https://api.github.com/users/pkg/gists{/gist_id}","starred_url":"https://api.github.com/users/pkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkg/subscriptions","organizations_url":"https://api.github.com/users/pkg/orgs","repos_url":"https://api.github.com/users/pkg/repos","events_url":"https://api.github.com/users/pkg/events{/privacy}","received_events_url":"https://api.github.com/users/pkg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pkg/sftp","description":"SFTP support for the go.crypto/ssh package","fork":false,"url":"https://api.github.com/repos/pkg/sftp","forks_url":"https://api.github.com/repos/pkg/sftp/forks","keys_url":"https://api.github.com/repos/pkg/sftp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pkg/sftp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pkg/sftp/teams","hooks_url":"https://api.github.com/repos/pkg/sftp/hooks","issue_events_url":"https://api.github.com/repos/pkg/sftp/issues/events{/number}","events_url":"https://api.github.com/repos/pkg/sftp/events","assignees_url":"https://api.github.com/repos/pkg/sftp/assignees{/user}","branches_url":"https://api.github.com/repos/pkg/sftp/branches{/branch}","tags_url":"https://api.github.com/repos/pkg/sftp/tags","blobs_url":"https://api.github.com/repos/pkg/sftp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pkg/sftp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pkg/sftp/git/refs{/sha}","trees_url":"https://api.github.com/repos/pkg/sftp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pkg/sftp/statuses/{sha}","languages_url":"https://api.github.com/repos/pkg/sftp/languages","stargazers_url":"https://api.github.com/repos/pkg/sftp/stargazers","contributors_url":"https://api.github.com/repos/pkg/sftp/contributors","subscribers_url":"https://api.github.com/repos/pkg/sftp/subscribers","subscription_url":"https://api.github.com/repos/pkg/sftp/subscription","commits_url":"https://api.github.com/repos/pkg/sftp/commits{/sha}","git_commits_url":"https://api.github.com/repos/pkg/sftp/git/commits{/sha}","comments_url":"https://api.github.com/repos/pkg/sftp/comments{/number}","issue_comment_url":"https://api.github.com/repos/pkg/sftp/issues/comments{/number}","contents_url":"https://api.github.com/repos/pkg/sftp/contents/{+path}","compare_url":"https://api.github.com/repos/pkg/sftp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pkg/sftp/merges","archive_url":"https://api.github.com/repos/pkg/sftp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pkg/sftp/downloads","issues_url":"https://api.github.com/repos/pkg/sftp/issues{/number}","pulls_url":"https://api.github.com/repos/pkg/sftp/pulls{/number}","milestones_url":"https://api.github.com/repos/pkg/sftp/milestones{/number}","notifications_url":"https://api.github.com/repos/pkg/sftp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pkg/sftp/labels{/name}","releases_url":"https://api.github.com/repos/pkg/sftp/releases{/id}","deployments_url":"https://api.github.com/repos/pkg/sftp/deployments","created_at":"2013-11-05T04:36:00Z","updated_at":"2016-07-28T03:40:39Z","pushed_at":"2016-08-02T02:08:23Z","git_url":"git://github.com/pkg/sftp.git","ssh_url":"git@github.com:pkg/sftp.git","clone_url":"https://github.com/pkg/sftp.git","svn_url":"https://github.com/pkg/sftp","homepage":null,"size":1707,"stargazers_count":267,"watchers_count":267,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":14,"forks":83,"open_issues":14,"watchers":267,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pkg/sftp/pulls/129"},"html":{"href":"https://github.com/pkg/sftp/pull/129"},"issue":{"href":"https://api.github.com/repos/pkg/sftp/issues/129"},"comments":{"href":"https://api.github.com/repos/pkg/sftp/issues/129/comments"},"review_comments":{"href":"https://api.github.com/repos/pkg/sftp/pulls/129/comments"},"review_comment":{"href":"https://api.github.com/repos/pkg/sftp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pkg/sftp/pulls/129/commits"},"statuses":{"href":"https://api.github.com/repos/pkg/sftp/statuses/00927fb459ff7e2a70dd12903a5554ca2b2cfe0c"}}}}
{"actor":{"display_login":"houndci-bot"}}