{"action":"created","comment":{"url":"https://api.github.com/repos/minio/minio-go/pulls/comments/48428570","id":48428570,"diff_hunk":"@@ -130,122 +131,176 @@ func (c Client) GetBucketACL(bucketName string) (BucketACL, error) {\n \n // GetObject gets object content from specified bucket.\n // You may also look at GetPartialObject.\n-func (c Client) GetObject(bucketName, objectName string) (io.ReadSeeker, error) {\n+func (c Client) GetObject(bucketName, objectName string) (io.ReadCloser, ObjectStat, error) {\n \tif err := isValidBucketName(bucketName); err != nil {\n-\t\treturn nil, err\n+\t\treturn nil, ObjectStat{}, err\n \t}\n \tif err := isValidObjectName(objectName); err != nil {\n-\t\treturn nil, err\n+\t\treturn nil, ObjectStat{}, err\n \t}\n-\t// get object.\n-\treturn newObjectReadSeeker(c, bucketName, objectName), nil\n+\t// get the whole object as a stream, no seek or resume supported for this.\n+\treturn c.getObject(bucketName, objectName, 0, 0)\n }\n \n-// GetPartialObject gets partial object content as specified by the Range.\n-//\n-// Setting offset and length = 0 will download the full object.\n-// For more information about the HTTP Range header,\n-// go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35\n-func (c Client) GetPartialObject(bucketName, objectName string, offset, length int64) (io.ReadSeeker, error) {\n+// ReadAtCloser readat closer interface.\n+type ReadAtCloser interface {\n+\tio.ReaderAt\n+\tio.Closer\n+}\n+\n+// GetObjectPartial returns a io.ReadAt for reading sparse entries.\n+func (c Client) GetObjectPartial(bucketName, objectName string) (ReadAtCloser, ObjectStat, error) {\n \tif err := isValidBucketName(bucketName); err != nil {\n-\t\treturn nil, err\n+\t\treturn nil, ObjectStat{}, err\n \t}\n \tif err := isValidObjectName(objectName); err != nil {\n-\t\treturn nil, err\n+\t\treturn nil, ObjectStat{}, err\n \t}\n-\t// get partial object.\n-\treturn newObjectReadSeeker(c, bucketName, objectName), nil\n+\t// Send an explicit stat to get the actual object size.\n+\tobjectStat, err := c.StatObject(bucketName, objectName)\n+\tif err != nil {\n+\t\treturn nil, ObjectStat{}, err\n+\t}\n+\n+\t// Create request channel.\n+\treqCh := make(chan readAtRequest)\n+\t// Create response channel.\n+\tresCh := make(chan readAtResponse)\n+\t// Create done channel.\n+\tdoneCh := make(chan struct{})\n+\n+\tgo func() {","path":"api-get.go","position":69,"original_position":69,"commit_id":"92a44d5fa898f72ccc929f7df5f6db322afa16d8","original_commit_id":"92a44d5fa898f72ccc929f7df5f6db322afa16d8","user":{"login":"abperiasamy","id":624261,"avatar_url":"https://avatars.githubusercontent.com/u/624261?v=3","gravatar_id":"","url":"https://api.github.com/users/abperiasamy","html_url":"https://github.com/abperiasamy","followers_url":"https://api.github.com/users/abperiasamy/followers","following_url":"https://api.github.com/users/abperiasamy/following{/other_user}","gists_url":"https://api.github.com/users/abperiasamy/gists{/gist_id}","starred_url":"https://api.github.com/users/abperiasamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abperiasamy/subscriptions","organizations_url":"https://api.github.com/users/abperiasamy/orgs","repos_url":"https://api.github.com/users/abperiasamy/repos","events_url":"https://api.github.com/users/abperiasamy/events{/privacy}","received_events_url":"https://api.github.com/users/abperiasamy/received_events","type":"User","site_admin":false},"body":"Add a comment here for the go routine about what it does.\r\n","created_at":"2015-12-25T01:25:14Z","updated_at":"2015-12-25T01:25:14Z","html_url":"https://github.com/minio/minio-go/pull/272#discussion_r48428570","pull_request_url":"https://api.github.com/repos/minio/minio-go/pulls/272","_links":{"self":{"href":"https://api.github.com/repos/minio/minio-go/pulls/comments/48428570"},"html":{"href":"https://github.com/minio/minio-go/pull/272#discussion_r48428570"},"pull_request":{"href":"https://api.github.com/repos/minio/minio-go/pulls/272"}}},"pull_request":{"url":"https://api.github.com/repos/minio/minio-go/pulls/272","id":54321242,"html_url":"https://github.com/minio/minio-go/pull/272","diff_url":"https://github.com/minio/minio-go/pull/272.diff","patch_url":"https://github.com/minio/minio-go/pull/272.patch","issue_url":"https://api.github.com/repos/minio/minio-go/issues/272","number":272,"state":"open","locked":false,"title":"cleanup: Fix fput object, put object and getObjectPartial behavior.","user":{"login":"harshavardhana","id":622699,"avatar_url":"https://avatars.githubusercontent.com/u/622699?v=3","gravatar_id":"","url":"https://api.github.com/users/harshavardhana","html_url":"https://github.com/harshavardhana","followers_url":"https://api.github.com/users/harshavardhana/followers","following_url":"https://api.github.com/users/harshavardhana/following{/other_user}","gists_url":"https://api.github.com/users/harshavardhana/gists{/gist_id}","starred_url":"https://api.github.com/users/harshavardhana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harshavardhana/subscriptions","organizations_url":"https://api.github.com/users/harshavardhana/orgs","repos_url":"https://api.github.com/users/harshavardhana/repos","events_url":"https://api.github.com/users/harshavardhana/events{/privacy}","received_events_url":"https://api.github.com/users/harshavardhana/received_events","type":"User","site_admin":false},"body":"- Remove usage of channels and section/part managers.\r\n- Implement ReaderAt interface rather than io.ReadSeeker\r\n- PutObject takes only a Reader and verifies md5sum before upload.\r\n- FPutObject verifies md5sum before upload.","created_at":"2015-12-22T00:52:27Z","updated_at":"2015-12-25T01:25:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49bcad8eb7bed6bc7a701c475cd89e496e7486f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/minio/minio-go/pulls/272/commits","review_comments_url":"https://api.github.com/repos/minio/minio-go/pulls/272/comments","review_comment_url":"https://api.github.com/repos/minio/minio-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/minio/minio-go/issues/272/comments","statuses_url":"https://api.github.com/repos/minio/minio-go/statuses/92a44d5fa898f72ccc929f7df5f6db322afa16d8","head":{"label":"harshavardhana:parts-rewrite","ref":"parts-rewrite","sha":"92a44d5fa898f72ccc929f7df5f6db322afa16d8","user":{"login":"harshavardhana","id":622699,"avatar_url":"https://avatars.githubusercontent.com/u/622699?v=3","gravatar_id":"","url":"https://api.github.com/users/harshavardhana","html_url":"https://github.com/harshavardhana","followers_url":"https://api.github.com/users/harshavardhana/followers","following_url":"https://api.github.com/users/harshavardhana/following{/other_user}","gists_url":"https://api.github.com/users/harshavardhana/gists{/gist_id}","starred_url":"https://api.github.com/users/harshavardhana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harshavardhana/subscriptions","organizations_url":"https://api.github.com/users/harshavardhana/orgs","repos_url":"https://api.github.com/users/harshavardhana/repos","events_url":"https://api.github.com/users/harshavardhana/events{/privacy}","received_events_url":"https://api.github.com/users/harshavardhana/received_events","type":"User","site_admin":false},"repo":{"id":35012786,"name":"minio-go","full_name":"harshavardhana/minio-go","owner":{"login":"harshavardhana","id":622699,"avatar_url":"https://avatars.githubusercontent.com/u/622699?v=3","gravatar_id":"","url":"https://api.github.com/users/harshavardhana","html_url":"https://github.com/harshavardhana","followers_url":"https://api.github.com/users/harshavardhana/followers","following_url":"https://api.github.com/users/harshavardhana/following{/other_user}","gists_url":"https://api.github.com/users/harshavardhana/gists{/gist_id}","starred_url":"https://api.github.com/users/harshavardhana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harshavardhana/subscriptions","organizations_url":"https://api.github.com/users/harshavardhana/orgs","repos_url":"https://api.github.com/users/harshavardhana/repos","events_url":"https://api.github.com/users/harshavardhana/events{/privacy}","received_events_url":"https://api.github.com/users/harshavardhana/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/harshavardhana/minio-go","description":"Object storage library for Go programming language","fork":true,"url":"https://api.github.com/repos/harshavardhana/minio-go","forks_url":"https://api.github.com/repos/harshavardhana/minio-go/forks","keys_url":"https://api.github.com/repos/harshavardhana/minio-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harshavardhana/minio-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harshavardhana/minio-go/teams","hooks_url":"https://api.github.com/repos/harshavardhana/minio-go/hooks","issue_events_url":"https://api.github.com/repos/harshavardhana/minio-go/issues/events{/number}","events_url":"https://api.github.com/repos/harshavardhana/minio-go/events","assignees_url":"https://api.github.com/repos/harshavardhana/minio-go/assignees{/user}","branches_url":"https://api.github.com/repos/harshavardhana/minio-go/branches{/branch}","tags_url":"https://api.github.com/repos/harshavardhana/minio-go/tags","blobs_url":"https://api.github.com/repos/harshavardhana/minio-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harshavardhana/minio-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harshavardhana/minio-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/harshavardhana/minio-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harshavardhana/minio-go/statuses/{sha}","languages_url":"https://api.github.com/repos/harshavardhana/minio-go/languages","stargazers_url":"https://api.github.com/repos/harshavardhana/minio-go/stargazers","contributors_url":"https://api.github.com/repos/harshavardhana/minio-go/contributors","subscribers_url":"https://api.github.com/repos/harshavardhana/minio-go/subscribers","subscription_url":"https://api.github.com/repos/harshavardhana/minio-go/subscription","commits_url":"https://api.github.com/repos/harshavardhana/minio-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/harshavardhana/minio-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/harshavardhana/minio-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/harshavardhana/minio-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/harshavardhana/minio-go/contents/{+path}","compare_url":"https://api.github.com/repos/harshavardhana/minio-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harshavardhana/minio-go/merges","archive_url":"https://api.github.com/repos/harshavardhana/minio-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harshavardhana/minio-go/downloads","issues_url":"https://api.github.com/repos/harshavardhana/minio-go/issues{/number}","pulls_url":"https://api.github.com/repos/harshavardhana/minio-go/pulls{/number}","milestones_url":"https://api.github.com/repos/harshavardhana/minio-go/milestones{/number}","notifications_url":"https://api.github.com/repos/harshavardhana/minio-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harshavardhana/minio-go/labels{/name}","releases_url":"https://api.github.com/repos/harshavardhana/minio-go/releases{/id}","created_at":"2015-05-04T03:48:45Z","updated_at":"2015-05-23T22:56:15Z","pushed_at":"2015-12-25T00:50:43Z","git_url":"git://github.com/harshavardhana/minio-go.git","ssh_url":"git@github.com:harshavardhana/minio-go.git","clone_url":"https://github.com/harshavardhana/minio-go.git","svn_url":"https://github.com/harshavardhana/minio-go","homepage":"","size":3179,"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":"minio:master","ref":"master","sha":"61aba3f9910f920fee22fb0e15f065c93be65b37","user":{"login":"minio","id":695951,"avatar_url":"https://avatars.githubusercontent.com/u/695951?v=3","gravatar_id":"","url":"https://api.github.com/users/minio","html_url":"https://github.com/minio","followers_url":"https://api.github.com/users/minio/followers","following_url":"https://api.github.com/users/minio/following{/other_user}","gists_url":"https://api.github.com/users/minio/gists{/gist_id}","starred_url":"https://api.github.com/users/minio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minio/subscriptions","organizations_url":"https://api.github.com/users/minio/orgs","repos_url":"https://api.github.com/users/minio/repos","events_url":"https://api.github.com/users/minio/events{/privacy}","received_events_url":"https://api.github.com/users/minio/received_events","type":"Organization","site_admin":false},"repo":{"id":34933072,"name":"minio-go","full_name":"minio/minio-go","owner":{"login":"minio","id":695951,"avatar_url":"https://avatars.githubusercontent.com/u/695951?v=3","gravatar_id":"","url":"https://api.github.com/users/minio","html_url":"https://github.com/minio","followers_url":"https://api.github.com/users/minio/followers","following_url":"https://api.github.com/users/minio/following{/other_user}","gists_url":"https://api.github.com/users/minio/gists{/gist_id}","starred_url":"https://api.github.com/users/minio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minio/subscriptions","organizations_url":"https://api.github.com/users/minio/orgs","repos_url":"https://api.github.com/users/minio/repos","events_url":"https://api.github.com/users/minio/events{/privacy}","received_events_url":"https://api.github.com/users/minio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/minio/minio-go","description":"Minio Go Library for Amazon S3 compatible cloud storage","fork":false,"url":"https://api.github.com/repos/minio/minio-go","forks_url":"https://api.github.com/repos/minio/minio-go/forks","keys_url":"https://api.github.com/repos/minio/minio-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minio/minio-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minio/minio-go/teams","hooks_url":"https://api.github.com/repos/minio/minio-go/hooks","issue_events_url":"https://api.github.com/repos/minio/minio-go/issues/events{/number}","events_url":"https://api.github.com/repos/minio/minio-go/events","assignees_url":"https://api.github.com/repos/minio/minio-go/assignees{/user}","branches_url":"https://api.github.com/repos/minio/minio-go/branches{/branch}","tags_url":"https://api.github.com/repos/minio/minio-go/tags","blobs_url":"https://api.github.com/repos/minio/minio-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minio/minio-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minio/minio-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/minio/minio-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minio/minio-go/statuses/{sha}","languages_url":"https://api.github.com/repos/minio/minio-go/languages","stargazers_url":"https://api.github.com/repos/minio/minio-go/stargazers","contributors_url":"https://api.github.com/repos/minio/minio-go/contributors","subscribers_url":"https://api.github.com/repos/minio/minio-go/subscribers","subscription_url":"https://api.github.com/repos/minio/minio-go/subscription","commits_url":"https://api.github.com/repos/minio/minio-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/minio/minio-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/minio/minio-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/minio/minio-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/minio/minio-go/contents/{+path}","compare_url":"https://api.github.com/repos/minio/minio-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minio/minio-go/merges","archive_url":"https://api.github.com/repos/minio/minio-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minio/minio-go/downloads","issues_url":"https://api.github.com/repos/minio/minio-go/issues{/number}","pulls_url":"https://api.github.com/repos/minio/minio-go/pulls{/number}","milestones_url":"https://api.github.com/repos/minio/minio-go/milestones{/number}","notifications_url":"https://api.github.com/repos/minio/minio-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minio/minio-go/labels{/name}","releases_url":"https://api.github.com/repos/minio/minio-go/releases{/id}","created_at":"2015-05-02T02:36:46Z","updated_at":"2015-12-14T11:43:07Z","pushed_at":"2015-12-25T00:50:43Z","git_url":"git://github.com/minio/minio-go.git","ssh_url":"git@github.com:minio/minio-go.git","clone_url":"https://github.com/minio/minio-go.git","svn_url":"https://github.com/minio/minio-go","homepage":"https://minio.io/#libraries","size":3237,"stargazers_count":62,"watchers_count":62,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":8,"forks":10,"open_issues":8,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minio/minio-go/pulls/272"},"html":{"href":"https://github.com/minio/minio-go/pull/272"},"issue":{"href":"https://api.github.com/repos/minio/minio-go/issues/272"},"comments":{"href":"https://api.github.com/repos/minio/minio-go/issues/272/comments"},"review_comments":{"href":"https://api.github.com/repos/minio/minio-go/pulls/272/comments"},"review_comment":{"href":"https://api.github.com/repos/minio/minio-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/minio/minio-go/pulls/272/commits"},"statuses":{"href":"https://api.github.com/repos/minio/minio-go/statuses/92a44d5fa898f72ccc929f7df5f6db322afa16d8"}}}}