introduce Client.GetArchiveReader #476

Merged
6543 merged 2 commits from petergardfjall/go-sdk:get-archive-with-readcloser into master 2021-01-17 17:14:08 +00:00
Contributor

This PR fix #475

It complements the Client.GetArchive call, which returns a byte slice and hence is unsuitable for use with large repositories, with a Client.GetArchiveReader method that returns a io.ReadCloser that streams the retrieved archvie and, therefore, induces a much smaller memory footprint on the calling client.

This PR fix #475 It complements the `Client.GetArchive` call, which returns a byte slice and hence is unsuitable for use with large repositories, with a `Client.GetArchiveReader` method that returns a `io.ReadCloser` that streams the retrieved archvie and, therefore, induces a much smaller memory footprint on the calling client.
petergardfjall force-pushed get-archive-with-readcloser from 244a7cda6c to c7fe43a3c5 2021-01-15 13:56:43 +00:00 Compare
6543 reviewed 2021-01-15 14:41:11 +00:00
Dismissed
gitea/repo.go Outdated
@ -423,0 +426,4 @@
// such as a branch name (`master`), a commit hash (`70b7c74b33`), a tag
// (`v1.2.1`). The archive is returned as a byte stream in a ReadCloser. It is
// the responsibility of the client to close the reader.
func (c *Client) GetArchiveReader(owner, repo, ref string, ext ArchiveType) (io.ReadCloser, error) {
Owner

does it cost us resources to return resp iteslve too?

I think not ... and for consistency it should be returned too

does it cost us resources to return resp iteslve too? I think not ... and for consistency it should be returned too
Author
Contributor

True. Fixed in 17a5f72

True. Fixed in 17a5f72
6543 added this to the v0.14.0 milestone 2021-01-15 14:42:22 +00:00
6543 added the
kind/feature
label 2021-01-15 14:42:29 +00:00
petergardfjall added 1 commit 2021-01-15 14:50:18 +00:00
better align GetArchiveReader method signature with API conventions
All checks were successful
continuous-integration/drone/pr Build is passing
17a5f726a9
6543 approved these changes 2021-01-15 14:52:23 +00:00
Dismissed
6543 left a comment
Owner

?

?
noerw approved these changes 2021-01-17 15:22:21 +00:00
Dismissed
6543 merged commit ff00c13597 into master 2021-01-17 17:14:08 +00:00
6543 referenced this issue from a commit 2021-01-17 17:14:08 +00:00
Sign in to join this conversation.
No description provided.