MCPcopy Index your code
hub / github.com/google/go-github / DownloadContents

Method DownloadContents

github/repos_contents.go:149–152  ·  view source on GitHub ↗

DownloadContents returns an io.ReadCloser that reads the contents of the specified file. This function will work with files of any size, as opposed to GetContents which is limited to 1 Mb files. It is the caller's responsibility to close the ReadCloser. It is possible for the download to result in

(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions)

Source from the content-addressed store, hash-verified

147//
148//meta:operation GET /repos/{owner}/{repo}/contents/{path}
149func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) {
150 rc, _, resp, err := s.DownloadContentsWithMeta(ctx, owner, repo, filepath, opts)
151 return rc, resp, err
152}
153
154// DownloadContentsWithMeta is identical to DownloadContents but additionally
155// returns the RepositoryContent of the requested file. This additional data

Calls 1