introduce Client.GetArchiveReader #476

Merged
6543 merged 2 commits from petergardfjall/go-sdk:get-archive-with-readcloser into master 9 months ago

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 added 1 commit 9 months ago
244a7cda6c introduce Client.GetArchiveReader
petergardfjall force-pushed get-archive-with-readcloser from 244a7cda6c to c7fe43a3c5 9 months ago
6543 reviewed 9 months ago
Dismissed
gitea/repo.go Outdated
// 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) {
6543 commented 9 months ago
Poster
Collaborator

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
Poster

True. Fixed in 17a5f72

True. Fixed in 17a5f72
6543 added this to the v0.14.0 milestone 9 months ago
6543 added the
kind/feature
label 9 months ago
petergardfjall added 1 commit 9 months ago
6543 approved these changes 9 months ago
Dismissed
6543 left a comment

👍

noerw approved these changes 9 months ago
Dismissed
6543 merged commit ff00c13597 into master 9 months ago
6543 referenced this issue from a commit 9 months ago
cameronbraid referenced this issue from a commit 9 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as ff00c13597.
Sign in to join this conversation.
Loading…
There is no content yet.