{"action":"created","issue":{"url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/270","labels_url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/270/comments","events_url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/270/events","html_url":"https://github.com/fsouza/go-dockerclient/pull/270","id":73477059,"number":270,"title":"Add /container/ID/logs endpoint to test server","user":{"login":"KAllan357","id":221009,"avatar_url":"https://avatars.githubusercontent.com/u/221009?v=3","gravatar_id":"","url":"https://api.github.com/users/KAllan357","html_url":"https://github.com/KAllan357","followers_url":"https://api.github.com/users/KAllan357/followers","following_url":"https://api.github.com/users/KAllan357/following{/other_user}","gists_url":"https://api.github.com/users/KAllan357/gists{/gist_id}","starred_url":"https://api.github.com/users/KAllan357/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KAllan357/subscriptions","organizations_url":"https://api.github.com/users/KAllan357/orgs","repos_url":"https://api.github.com/users/KAllan357/repos","events_url":"https://api.github.com/users/KAllan357/events{/privacy}","received_events_url":"https://api.github.com/users/KAllan357/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-06T00:50:12Z","updated_at":"2015-05-10T17:21:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fsouza/go-dockerclient/pulls/270","html_url":"https://github.com/fsouza/go-dockerclient/pull/270","diff_url":"https://github.com/fsouza/go-dockerclient/pull/270.diff","patch_url":"https://github.com/fsouza/go-dockerclient/pull/270.patch"},"body":"Hi @fsouza,\r\n\r\nI'd like some feedback on this one:\r\n\r\nI wanted to test the logs endpoint on the test docker server, to ensure my code was operating correctly using `client.Logs(opts)`.\r\n\r\nIf I'm understanding correctly, the test server is writing out data using the code from [writer.go](https://github.com/fsouza/go-dockerclient/blob/master/testing/writer.go). It looks like that in order to read what the writer has written, I'd want to use the `stdCopy` function in stdcopy.go. Unfortunately, the `stdCopy` function is private in this repo.\r\n\r\nI'm guessing it might be copied from docker themselves (https://github.com/docker/docker/blob/master/pkg/stdcopy/stdcopy.go) where its public. Perhaps you'd be okay with making `stdCopy` a public function in this repo so the test can strip off the extra docker bytes?\r\n\r\nAnyway, besides any feedback you might have, I think there is room for a little more testing here."},"comment":{"url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/comments/100671073","html_url":"https://github.com/fsouza/go-dockerclient/pull/270#issuecomment-100671073","issue_url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/270","id":100671073,"user":{"login":"fsouza","id":108725,"avatar_url":"https://avatars.githubusercontent.com/u/108725?v=3","gravatar_id":"","url":"https://api.github.com/users/fsouza","html_url":"https://github.com/fsouza","followers_url":"https://api.github.com/users/fsouza/followers","following_url":"https://api.github.com/users/fsouza/following{/other_user}","gists_url":"https://api.github.com/users/fsouza/gists{/gist_id}","starred_url":"https://api.github.com/users/fsouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsouza/subscriptions","organizations_url":"https://api.github.com/users/fsouza/orgs","repos_url":"https://api.github.com/users/fsouza/repos","events_url":"https://api.github.com/users/fsouza/events{/privacy}","received_events_url":"https://api.github.com/users/fsouza/received_events","type":"User","site_admin":false},"created_at":"2015-05-10T17:21:34Z","updated_at":"2015-05-10T17:21:34Z","body":"Hi @KAllan357, in order to write a CustomHandler, you'd need to write the stream header before writing the content, just like stdWriter does."}}